From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Siddartha Mohanadoss <smohanad@codeaurora.org>
Subject: [PATCH v2 4/4] iio: adc: qcom-vadc: Move symbol exports to IIO_QCOM_VADC namespace
Date: Sat, 4 Jun 2022 16:53:06 +0100 [thread overview]
Message-ID: <20220604155306.422937-5-jic23@kernel.org> (raw)
In-Reply-To: <20220604155306.422937-1-jic23@kernel.org>
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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@huawei.com>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Siddartha Mohanadoss <smohanad@codeaurora.org>
Link: https://lore.kernel.org/r/20220220173701.502331-6-jic23@kernel.org
---
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@mm-sol.com>");
MODULE_AUTHOR("Ivan T. Ivanov <iivanov@mm-sol.com>");
+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 d5209f32adb3..7ca191ea1a65 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);
u16 qcom_adc_tm5_gen2_temp_res_scale(int temp)
{
@@ -704,7 +704,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)
{
@@ -720,7 +720,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)
@@ -734,7 +734,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)
{
@@ -743,7 +743,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)
{
@@ -756,7 +756,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)
{
@@ -766,7 +766,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.36.1
next prev parent reply other threads:[~2022-06-04 15:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-04 15:53 [PATCH v2 0/4] 3rd set of IIO export namespaces Jonathan Cameron
2022-06-04 15:53 ` [PATCH v2 1/4] iio: imu: bmi160: Move exported symbols to IIO_BMI160 namespace Jonathan Cameron
2022-06-04 15:53 ` [PATCH v2 2/4] iio: pressure: bmp280: Move symbol exports to IIO_BMP280 namespace Jonathan Cameron
2022-06-04 15:53 ` [PATCH v2 3/4] iio: chemical: sps30: Move symbol exports into IIO_SPS30 namespace Jonathan Cameron
2022-06-04 15:53 ` Jonathan Cameron [this message]
2022-07-01 10:15 ` [PATCH v2 4/4] iio: adc: qcom-vadc: Move symbol exports to IIO_QCOM_VADC namespace Jonathan Cameron
2022-06-18 13:20 ` [PATCH v2 0/4] 3rd set of IIO export namespaces Jonathan Cameron
2022-06-21 3:37 ` Joe Simmons-Talbott
2022-06-21 20:31 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220604155306.422937-5-jic23@kernel.org \
--to=jic23@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=dmitry.baryshkov@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=smohanad@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).