[PATCH 5/5] iio: adc: qcom-vadc: Move symbol exports to IIO_QCOM_VADC namespace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>

Avoid unnecessary pollution of the global symbol namespace by
moving library functions in to a specific namespace and import
that into the drivers that make use of the functions.

For more info: https://lwn.net/Articles/760045/

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
Cc: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx>
Cc: Siddartha Mohanadoss <smohanad@xxxxxxxxxxxxxx>
---
 drivers/iio/adc/qcom-pm8xxx-xoadc.c |  1 +
 drivers/iio/adc/qcom-spmi-adc5.c    |  1 +
 drivers/iio/adc/qcom-spmi-vadc.c    |  1 +
 drivers/iio/adc/qcom-vadc-common.c  | 16 ++++++++--------
 4 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/iio/adc/qcom-pm8xxx-xoadc.c b/drivers/iio/adc/qcom-pm8xxx-xoadc.c
index 5e9e56821075..e2ef89dcaa5e 100644
--- a/drivers/iio/adc/qcom-pm8xxx-xoadc.c
+++ b/drivers/iio/adc/qcom-pm8xxx-xoadc.c
@@ -1028,3 +1028,4 @@ module_platform_driver(pm8xxx_xoadc_driver);
 MODULE_DESCRIPTION("PM8xxx XOADC driver");
 MODULE_LICENSE("GPL v2");
 MODULE_ALIAS("platform:pm8xxx-xoadc");
+MODULE_IMPORT_NS(IIO_QCOM_VADC);
diff --git a/drivers/iio/adc/qcom-spmi-adc5.c b/drivers/iio/adc/qcom-spmi-adc5.c
index 87438d1e5c0b..10bb51b648c1 100644
--- a/drivers/iio/adc/qcom-spmi-adc5.c
+++ b/drivers/iio/adc/qcom-spmi-adc5.c
@@ -925,3 +925,4 @@ module_platform_driver(adc5_driver);
 MODULE_ALIAS("platform:qcom-spmi-adc5");
 MODULE_DESCRIPTION("Qualcomm Technologies Inc. PMIC5 ADC driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_QCOM_VADC);
diff --git a/drivers/iio/adc/qcom-spmi-vadc.c b/drivers/iio/adc/qcom-spmi-vadc.c
index 34202ba52469..cb0c6af091ac 100644
--- a/drivers/iio/adc/qcom-spmi-vadc.c
+++ b/drivers/iio/adc/qcom-spmi-vadc.c
@@ -935,3 +935,4 @@ MODULE_DESCRIPTION("Qualcomm SPMI PMIC voltage ADC driver");
 MODULE_LICENSE("GPL v2");
 MODULE_AUTHOR("Stanimir Varbanov <svarbanov@xxxxxxxxxx>");
 MODULE_AUTHOR("Ivan T. Ivanov <iivanov@xxxxxxxxxx>");
+MODULE_IMPORT_NS(IIO_QCOM_VADC);
diff --git a/drivers/iio/adc/qcom-vadc-common.c b/drivers/iio/adc/qcom-vadc-common.c
index 6c6aec848f98..e1ff2ac309fd 100644
--- a/drivers/iio/adc/qcom-vadc-common.c
+++ b/drivers/iio/adc/qcom-vadc-common.c
@@ -662,7 +662,7 @@ int qcom_vadc_scale(enum vadc_scale_fn_type scaletype,
 		return -EINVAL;
 	}
 }
-EXPORT_SYMBOL(qcom_vadc_scale);
+EXPORT_SYMBOL_NS(qcom_vadc_scale, IIO_QCOM_VADC);
 
 u16 qcom_adc_tm5_temp_volt_scale(unsigned int prescale_ratio,
 				 u32 full_scale_code_volt, int temp)
@@ -675,7 +675,7 @@ u16 qcom_adc_tm5_temp_volt_scale(unsigned int prescale_ratio,
 					     temp);
 	return qcom_vadc_scale_voltage_code(voltage, prescale, full_scale_code_volt, 1000);
 }
-EXPORT_SYMBOL(qcom_adc_tm5_temp_volt_scale);
+EXPORT_SYMBOL_NS(qcom_adc_tm5_temp_volt_scale, IIO_QCOM_VADC);
 
 int qcom_adc5_hw_scale(enum vadc_scale_fn_type scaletype,
 		    unsigned int prescale_ratio,
@@ -693,7 +693,7 @@ int qcom_adc5_hw_scale(enum vadc_scale_fn_type scaletype,
 	return scale_adc5_fn[scaletype].scale_fn(prescale, data,
 					adc_code, result);
 }
-EXPORT_SYMBOL(qcom_adc5_hw_scale);
+EXPORT_SYMBOL_NS(qcom_adc5_hw_scale, IIO_QCOM_VADC);
 
 int qcom_adc5_prescaling_from_dt(u32 numerator, u32 denominator)
 {
@@ -709,7 +709,7 @@ int qcom_adc5_prescaling_from_dt(u32 numerator, u32 denominator)
 
 	return pre;
 }
-EXPORT_SYMBOL(qcom_adc5_prescaling_from_dt);
+EXPORT_SYMBOL_NS(qcom_adc5_prescaling_from_dt, IIO_QCOM_VADC);
 
 int qcom_adc5_hw_settle_time_from_dt(u32 value,
 				     const unsigned int *hw_settle)
@@ -723,7 +723,7 @@ int qcom_adc5_hw_settle_time_from_dt(u32 value,
 
 	return -EINVAL;
 }
-EXPORT_SYMBOL(qcom_adc5_hw_settle_time_from_dt);
+EXPORT_SYMBOL_NS(qcom_adc5_hw_settle_time_from_dt, IIO_QCOM_VADC);
 
 int qcom_adc5_avg_samples_from_dt(u32 value)
 {
@@ -732,7 +732,7 @@ int qcom_adc5_avg_samples_from_dt(u32 value)
 
 	return __ffs(value);
 }
-EXPORT_SYMBOL(qcom_adc5_avg_samples_from_dt);
+EXPORT_SYMBOL_NS(qcom_adc5_avg_samples_from_dt, IIO_QCOM_VADC);
 
 int qcom_adc5_decimation_from_dt(u32 value, const unsigned int *decimation)
 {
@@ -745,7 +745,7 @@ int qcom_adc5_decimation_from_dt(u32 value, const unsigned int *decimation)
 
 	return -EINVAL;
 }
-EXPORT_SYMBOL(qcom_adc5_decimation_from_dt);
+EXPORT_SYMBOL_NS(qcom_adc5_decimation_from_dt, IIO_QCOM_VADC);
 
 int qcom_vadc_decimation_from_dt(u32 value)
 {
@@ -755,7 +755,7 @@ int qcom_vadc_decimation_from_dt(u32 value)
 
 	return __ffs64(value / VADC_DECIMATION_MIN);
 }
-EXPORT_SYMBOL(qcom_vadc_decimation_from_dt);
+EXPORT_SYMBOL_NS(qcom_vadc_decimation_from_dt, IIO_QCOM_VADC);
 
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("Qualcomm ADC common functionality");
-- 
2.35.1




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux