diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2019-08-19 19:17:13 +0200 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2019-08-20 13:41:25 +0200 |
commit | ad07819f223e26b30cc5ec25a31d906db0788600 (patch) | |
tree | 61425ee6ac56ab0e833c3be1c100951eb5c3ba68 /drivers/net/can | |
parent | 65668b32695652e81c86671f075ed45f9efcf0d7 (diff) |
can: tcan4x5x: remove not needed casts to struct tcan4x5x_priv *
The struct m_can_classdev::device_data is a void pointer, so there's no
need to cast it to struct tcan4x5x_priv *, when assigning the struct
tcan4x5x_priv pointer.
This patch removes the not needed casts from the tcan4x5x driver.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can')
-rw-r--r-- | drivers/net/can/m_can/tcan4x5x.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/net/can/m_can/tcan4x5x.c b/drivers/net/can/m_can/tcan4x5x.c index 57b2a69a60eb..a2d5e501a502 100644 --- a/drivers/net/can/m_can/tcan4x5x.c +++ b/drivers/net/can/m_can/tcan4x5x.c @@ -233,7 +233,7 @@ static struct regmap_bus tcan4x5x_bus = { static u32 tcan4x5x_read_reg(struct m_can_classdev *cdev, int reg) { - struct tcan4x5x_priv *priv = (struct tcan4x5x_priv *)cdev->device_data; + struct tcan4x5x_priv *priv = cdev->device_data; u32 val; tcan4x5x_check_wake(priv); @@ -245,7 +245,7 @@ static u32 tcan4x5x_read_reg(struct m_can_classdev *cdev, int reg) static u32 tcan4x5x_read_fifo(struct m_can_classdev *cdev, int addr_offset) { - struct tcan4x5x_priv *priv = (struct tcan4x5x_priv *)cdev->device_data; + struct tcan4x5x_priv *priv = cdev->device_data; u32 val; tcan4x5x_check_wake(priv); @@ -257,7 +257,7 @@ static u32 tcan4x5x_read_fifo(struct m_can_classdev *cdev, int addr_offset) static int tcan4x5x_write_reg(struct m_can_classdev *cdev, int reg, int val) { - struct tcan4x5x_priv *priv = (struct tcan4x5x_priv *)cdev->device_data; + struct tcan4x5x_priv *priv = cdev->device_data; tcan4x5x_check_wake(priv); @@ -267,8 +267,7 @@ static int tcan4x5x_write_reg(struct m_can_classdev *cdev, int reg, int val) static int tcan4x5x_write_fifo(struct m_can_classdev *cdev, int addr_offset, int val) { - struct tcan4x5x_priv *priv = - (struct tcan4x5x_priv *)cdev->device_data; + struct tcan4x5x_priv *priv = cdev->device_data; tcan4x5x_check_wake(priv); @@ -289,8 +288,7 @@ static int tcan4x5x_power_enable(struct regulator *reg, int enable) static int tcan4x5x_write_tcan_reg(struct m_can_classdev *cdev, int reg, int val) { - struct tcan4x5x_priv *priv = - (struct tcan4x5x_priv *)cdev->device_data; + struct tcan4x5x_priv *priv = cdev->device_data; tcan4x5x_check_wake(priv); @@ -299,8 +297,7 @@ static int tcan4x5x_write_tcan_reg(struct m_can_classdev *cdev, static int tcan4x5x_clear_interrupts(struct m_can_classdev *cdev) { - struct tcan4x5x_priv *tcan4x5x = - (struct tcan4x5x_priv *)cdev->device_data; + struct tcan4x5x_priv *tcan4x5x = cdev->device_data; int ret; tcan4x5x_check_wake(tcan4x5x); @@ -330,8 +327,7 @@ static int tcan4x5x_clear_interrupts(struct m_can_classdev *cdev) static int tcan4x5x_init(struct m_can_classdev *cdev) { - struct tcan4x5x_priv *tcan4x5x = - (struct tcan4x5x_priv *)cdev->device_data; + struct tcan4x5x_priv *tcan4x5x = cdev->device_data; int ret; tcan4x5x_check_wake(tcan4x5x); @@ -358,8 +354,7 @@ static int tcan4x5x_init(struct m_can_classdev *cdev) static int tcan4x5x_parse_config(struct m_can_classdev *cdev) { - struct tcan4x5x_priv *tcan4x5x = - (struct tcan4x5x_priv *)cdev->device_data; + struct tcan4x5x_priv *tcan4x5x = cdev->device_data; tcan4x5x->interrupt_gpio = devm_gpiod_get(cdev->dev, "data-ready", GPIOD_IN); |