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.

iio: adc: ltc2497: Get platform data via dev_get_platdata()

Access to platform data via dev_get_platdata() getter to make code cleaner.

While at it, drop duplicate NULL check that iio_map_array_register()
already has.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://patch.msgid.link/20240902222824.1145571-7-andy.shevchenko@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
d29ac012 b144b6f7

+5 -10
+5 -10
drivers/iio/adc/ltc2497-core.c
··· 168 168 int ltc2497core_probe(struct device *dev, struct iio_dev *indio_dev) 169 169 { 170 170 struct ltc2497core_driverdata *ddata = iio_priv(indio_dev); 171 + struct iio_map *plat_data = dev_get_platdata(dev); 171 172 int ret; 172 173 173 174 /* ··· 201 200 return ret; 202 201 } 203 202 204 - if (dev->platform_data) { 205 - struct iio_map *plat_data; 206 - 207 - plat_data = (struct iio_map *)dev->platform_data; 208 - 209 - ret = iio_map_array_register(indio_dev, plat_data); 210 - if (ret) { 211 - dev_err(&indio_dev->dev, "iio map err: %d\n", ret); 212 - goto err_regulator_disable; 213 - } 203 + ret = iio_map_array_register(indio_dev, plat_data); 204 + if (ret) { 205 + dev_err(&indio_dev->dev, "iio map err: %d\n", ret); 206 + goto err_regulator_disable; 214 207 } 215 208 216 209 ddata->addr_prev = LTC2497_CONFIG_DEFAULT;