From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
Lars-Peter Clausen <lars@metafoo.de>
Subject: Re: [PATCH v1 2/2] iio: adc: ti-adc128s052: Drop anti-pattern of ACPI_PTR() use
Date: Fri, 23 Dec 2022 15:24:44 +0000 [thread overview]
Message-ID: <20221223152444.63310805@jic23-huawei> (raw)
In-Reply-To: <20221214114944.83790-2-andriy.shevchenko@linux.intel.com>
On Wed, 14 Dec 2022 13:49:44 +0200
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> ACPI_PTR() is more harmful than helpful. For example, in this case
> if CONFIG_ACPI=n, the ID table left unused and code is obfuscated
> by ifdeffery.
>
> Drop anti-pattern of ACPI_PTR() use.
Longer term I wonder if we should just make ACPI_PTR() work the same
way as pm_ptr() now does so that the visibility is maintained and
we don't need the ifdef magic.
I'm sure there is someone out there somewhere who actually cares about
the minor costs of all these tables for their non ACPI platform and
doing something like that might make everyone happier.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Applied.
> ---
> drivers/iio/adc/ti-adc128s052.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s052.c
> index 9dfc625100b6..fc09ee6bb174 100644
> --- a/drivers/iio/adc/ti-adc128s052.c
> +++ b/drivers/iio/adc/ti-adc128s052.c
> @@ -9,7 +9,6 @@
> * https://www.ti.com/lit/ds/symlink/adc124s021.pdf
> */
>
> -#include <linux/acpi.h>
> #include <linux/err.h>
> #include <linux/spi/spi.h>
> #include <linux/module.h>
> @@ -201,19 +200,17 @@ static const struct spi_device_id adc128_id[] = {
> };
> MODULE_DEVICE_TABLE(spi, adc128_id);
>
> -#ifdef CONFIG_ACPI
> static const struct acpi_device_id adc128_acpi_match[] = {
> { "AANT1280", (kernel_ulong_t)&adc128_config[2] },
> { }
> };
> MODULE_DEVICE_TABLE(acpi, adc128_acpi_match);
> -#endif
>
> static struct spi_driver adc128_driver = {
> .driver = {
> .name = "adc128s052",
> .of_match_table = adc128_of_match,
> - .acpi_match_table = ACPI_PTR(adc128_acpi_match),
> + .acpi_match_table = adc128_acpi_match,
> },
> .probe = adc128_probe,
> .id_table = adc128_id,
next prev parent reply other threads:[~2022-12-23 15:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-14 11:49 [PATCH v1 1/2] iio: adc: ti-adc128s052: Switch to use spi_get_device_match_data() Andy Shevchenko
2022-12-14 11:49 ` [PATCH v1 2/2] iio: adc: ti-adc128s052: Drop anti-pattern of ACPI_PTR() use Andy Shevchenko
2022-12-23 15:24 ` Jonathan Cameron [this message]
2022-12-23 15:22 ` [PATCH v1 1/2] iio: adc: ti-adc128s052: Switch to use spi_get_device_match_data() Jonathan Cameron
2022-12-23 15:44 ` Jonathan Cameron
2022-12-28 9:59 ` Andy Shevchenko
2022-12-31 14:45 ` Jonathan Cameron
2022-12-31 18:24 ` Andy Shevchenko
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=20221223152444.63310805@jic23-huawei \
--to=jic23@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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