Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

i2c: rtl9300: remove const cast

These casts are used to remove const for no good reason. Fix the types
instead.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20251217063027.37987-2-rosenp@gmail.com

authored by

Rosen Penev and committed by
Andi Shyti
fc31008d bdc0c634

+4 -4
+4 -4
drivers/i2c/busses/i2c-rtl9300.c
··· 129 129 130 130 static int rtl9300_i2c_config_chan(struct rtl9300_i2c *i2c, struct rtl9300_i2c_chan *chan) 131 131 { 132 - struct rtl9300_i2c_drv_data *drv_data; 132 + const struct rtl9300_i2c_drv_data *drv_data; 133 133 int ret; 134 134 135 135 if (i2c->sda_num == chan->sda_num) ··· 139 139 if (ret) 140 140 return ret; 141 141 142 - drv_data = (struct rtl9300_i2c_drv_data *)device_get_match_data(i2c->dev); 142 + drv_data = device_get_match_data(i2c->dev); 143 143 ret = drv_data->select_scl(i2c, i2c->scl_num); 144 144 if (ret) 145 145 return ret; ··· 372 372 struct device *dev = &pdev->dev; 373 373 struct rtl9300_i2c *i2c; 374 374 struct fwnode_handle *child; 375 - struct rtl9300_i2c_drv_data *drv_data; 375 + const struct rtl9300_i2c_drv_data *drv_data; 376 376 struct reg_field fields[F_NUM_FIELDS]; 377 377 u32 clock_freq, scl_num, sda_num; 378 378 int ret, i = 0; ··· 399 399 400 400 platform_set_drvdata(pdev, i2c); 401 401 402 - drv_data = (struct rtl9300_i2c_drv_data *)device_get_match_data(i2c->dev); 402 + drv_data = device_get_match_data(i2c->dev); 403 403 if (device_get_child_node_count(dev) > drv_data->max_nchan) 404 404 return dev_err_probe(dev, -EINVAL, "Too many channels\n"); 405 405