diff options
author | Tejun Heo <tj@kernel.org> | 2018-12-27 18:05:30 -0800 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2018-12-27 18:05:30 -0800 |
commit | 4d71c6f8771a6bccb844244f09831fa4624b22c1 (patch) | |
tree | 9c6fdf753d64c839a4b0deb7d35d7e990c8e9971 /drivers/net/can/rcar/rcar_can.c | |
parent | 1e7eacaf1db2f0f5f62fceda4e6c5a8869f00c13 (diff) | |
parent | e9d81a1bc2c48ea9782e3e8b53875f419766ef47 (diff) | |
download | linux-4d71c6f8771a6bccb844244f09831fa4624b22c1.tar.bz2 |
Merge branch 'for-4.20-fixes' into for-4.21
Diffstat (limited to 'drivers/net/can/rcar/rcar_can.c')
-rw-r--r-- | drivers/net/can/rcar/rcar_can.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/can/rcar/rcar_can.c b/drivers/net/can/rcar/rcar_can.c index 11662f479e76..771a46083739 100644 --- a/drivers/net/can/rcar/rcar_can.c +++ b/drivers/net/can/rcar/rcar_can.c @@ -24,6 +24,9 @@ #define RCAR_CAN_DRV_NAME "rcar_can" +#define RCAR_SUPPORTED_CLOCKS (BIT(CLKR_CLKP1) | BIT(CLKR_CLKP2) | \ + BIT(CLKR_CLKEXT)) + /* Mailbox configuration: * mailbox 60 - 63 - Rx FIFO mailboxes * mailbox 56 - 59 - Tx FIFO mailboxes @@ -789,7 +792,7 @@ static int rcar_can_probe(struct platform_device *pdev) goto fail_clk; } - if (clock_select >= ARRAY_SIZE(clock_names)) { + if (!(BIT(clock_select) & RCAR_SUPPORTED_CLOCKS)) { err = -EINVAL; dev_err(&pdev->dev, "invalid CAN clock selected\n"); goto fail_clk; |