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: tsl2563: Drop legacy platform data code

There is no in-kernel user for legacy platform data.
Otherwise, a new one can use software nodes instead.
Hence, drop legacy platform data code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Ferry Toth <ftoth@exalondelft.nl>
Link: https://lore.kernel.org/r/20221207190348.9347-7-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
1f5e408f 2080c8d3

+2 -19
+2 -10
drivers/iio/light/tsl2563.c
··· 29 29 #include <linux/iio/iio.h> 30 30 #include <linux/iio/sysfs.h> 31 31 #include <linux/iio/events.h> 32 - #include <linux/platform_data/tsl2563.h> 33 32 34 33 /* Use this many bits for fraction part. */ 35 34 #define ADC_FRAC_BITS 14 ··· 697 698 struct device *dev = &client->dev; 698 699 struct iio_dev *indio_dev; 699 700 struct tsl2563_chip *chip; 700 - struct tsl2563_platform_data *pdata = client->dev.platform_data; 701 701 unsigned long irq_flags; 702 702 u8 id = 0; 703 703 int err; ··· 728 730 chip->calib0 = tsl2563_calib_from_sysfs(CALIB_BASE_SYSFS); 729 731 chip->calib1 = tsl2563_calib_from_sysfs(CALIB_BASE_SYSFS); 730 732 731 - if (pdata) { 732 - chip->cover_comp_gain = pdata->cover_comp_gain; 733 - } else { 734 - err = device_property_read_u32(&client->dev, "amstaos,cover-comp-gain", 735 - &chip->cover_comp_gain); 736 - if (err) 737 - chip->cover_comp_gain = 1; 738 - } 733 + chip->cover_comp_gain = 1; 734 + device_property_read_u32(dev, "amstaos,cover-comp-gain", &chip->cover_comp_gain); 739 735 740 736 dev_info(&client->dev, "model %d, rev. %d\n", id >> 4, id & 0x0f); 741 737 indio_dev->name = client->name;
-9
include/linux/platform_data/tsl2563.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifndef __LINUX_TSL2563_H 3 - #define __LINUX_TSL2563_H 4 - 5 - struct tsl2563_platform_data { 6 - int cover_comp_gain; 7 - }; 8 - 9 - #endif /* __LINUX_TSL2563_H */