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: proximity: sx_common: Unexport sx_common_get_raw_register_config()

sx_common_get_raw_register_config() is used in a single driver,
move it there.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20240903212922.3731221-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
9ebe06f1 b71e9e12

+20 -24
+20
drivers/iio/proximity/sx9324.c
··· 868 868 return raw; 869 869 } 870 870 871 + static void sx_common_get_raw_register_config(struct device *dev, 872 + struct sx_common_reg_default *reg_def) 873 + { 874 + #ifdef CONFIG_ACPI 875 + struct acpi_device *adev = ACPI_COMPANION(dev); 876 + u32 raw = 0, ret; 877 + char prop[80]; 878 + 879 + if (!reg_def->property || !adev) 880 + return; 881 + 882 + snprintf(prop, ARRAY_SIZE(prop), "%s,reg_%s", acpi_device_hid(adev), reg_def->property); 883 + ret = device_property_read_u32(dev, prop, &raw); 884 + if (ret) 885 + return; 886 + 887 + reg_def->def = raw; 888 + #endif 889 + } 890 + 871 891 static const struct sx_common_reg_default * 872 892 sx9324_get_default_reg(struct device *dev, int idx, 873 893 struct sx_common_reg_default *reg_def)
-21
drivers/iio/proximity/sx_common.c
··· 421 421 .postdisable = sx_common_buffer_postdisable, 422 422 }; 423 423 424 - void sx_common_get_raw_register_config(struct device *dev, 425 - struct sx_common_reg_default *reg_def) 426 - { 427 - #ifdef CONFIG_ACPI 428 - struct acpi_device *adev = ACPI_COMPANION(dev); 429 - u32 raw = 0, ret; 430 - char prop[80]; 431 - 432 - if (!reg_def->property || !adev) 433 - return; 434 - 435 - snprintf(prop, ARRAY_SIZE(prop), "%s,reg_%s", acpi_device_hid(adev), reg_def->property); 436 - ret = device_property_read_u32(dev, prop, &raw); 437 - if (ret) 438 - return; 439 - 440 - reg_def->def = raw; 441 - #endif 442 - } 443 - EXPORT_SYMBOL_NS_GPL(sx_common_get_raw_register_config, SEMTECH_PROX); 444 - 445 424 #define SX_COMMON_SOFT_RESET 0xde 446 425 447 426 static int sx_common_init_device(struct device *dev, struct iio_dev *indio_dev)
-3
drivers/iio/proximity/sx_common.h
··· 150 150 const struct sx_common_chip_info *chip_info, 151 151 const struct regmap_config *regmap_config); 152 152 153 - void sx_common_get_raw_register_config(struct device *dev, 154 - struct sx_common_reg_default *reg_def); 155 - 156 153 /* 3 is the number of events defined by a single phase. */ 157 154 extern const struct iio_event_spec sx_common_events[3]; 158 155