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: light: hid-sensor-als: Get platform data via dev_get_platdata()

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

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

authored by

Andy Shevchenko and committed by
Jonathan Cameron
a5b2f654 57063b1d

+2 -2
+2 -2
drivers/iio/light/hid-sensor-als.c
··· 356 356 /* Function to initialize the processing for usage id */ 357 357 static int hid_als_probe(struct platform_device *pdev) 358 358 { 359 + struct hid_sensor_hub_device *hsdev = dev_get_platdata(&pdev->dev); 359 360 int ret = 0; 360 361 static const char *name = "als"; 361 362 struct iio_dev *indio_dev; 362 363 struct als_state *als_state; 363 - struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; 364 364 365 365 indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(struct als_state)); 366 366 if (!indio_dev) ··· 438 438 /* Function to deinitialize the processing for usage id */ 439 439 static void hid_als_remove(struct platform_device *pdev) 440 440 { 441 - struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; 441 + struct hid_sensor_hub_device *hsdev = dev_get_platdata(&pdev->dev); 442 442 struct iio_dev *indio_dev = platform_get_drvdata(pdev); 443 443 struct als_state *als_state = iio_priv(indio_dev); 444 444