diff mbox

[1/2] iio: adc128s052: allow driver to be matched using ACPI

Message ID 20180419132036.27493-2-javier@emutex.com (mailing list archive)
State New, archived
Headers show

Commit Message

Javier Arteaga April 19, 2018, 1:20 p.m. UTC
From: Dan O'Donovan <dan@emutex.com>

Allow driver to be matched by compatible string in
ACPI device properties.

Signed-off-by: Dan O'Donovan <dan@emutex.com>
---
 drivers/iio/adc/ti-adc128s052.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jonathan Cameron April 21, 2018, 3:54 p.m. UTC | #1
On Thu, 19 Apr 2018 14:20:35 +0100
Javier Arteaga <javier@emutex.com> wrote:

> From: Dan O'Donovan <dan@emutex.com>
> 
> Allow driver to be matched by compatible string in
> ACPI device properties.
> 
> Signed-off-by: Dan O'Donovan <dan@emutex.com>
Hi Javier,

I don't really see the connection between the change in here
and what the description says...

If you are probing from ACPI then there is no need to ensure
a valid of table is supplied (even if we aren't building with OF)
which is what I think this patch is trying to do...

Jonathan

> ---
>  drivers/iio/adc/ti-adc128s052.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s052.c
> index 7cf39b3e2416..56ec04d1c68f 100644
> --- a/drivers/iio/adc/ti-adc128s052.c
> +++ b/drivers/iio/adc/ti-adc128s052.c
> @@ -202,7 +202,7 @@ MODULE_DEVICE_TABLE(spi, adc128_id);
>  static struct spi_driver adc128_driver = {
>  	.driver = {
>  		.name = "adc128s052",
> -		.of_match_table = of_match_ptr(adc128_of_match),
> +		.of_match_table = adc128_of_match,
>  	},
>  	.probe = adc128_probe,
>  	.remove = adc128_remove,

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Javier Arteaga April 21, 2018, 8:41 p.m. UTC | #2
Hi Jonathan,

On Sat, Apr 21, 2018 at 04:54:41PM +0100, Jonathan Cameron wrote:
> I don't really see the connection between the change in here
> and what the description says...

I think you're right, we didn't make our intent clear here.

> If you are probing from ACPI then there is no need to ensure
> a valid of table is supplied (even if we aren't building with OF)
> which is what I think this patch is trying to do...

The patch enables ACPI _DSD to reuse existing DT "compatible" strings,
as described in Documentation/acpi/enumeration.txt, even without OF.
This kind of patch has some precedent, like for example:

    01427fe7c4b9 ("Input: adxl34x - make it enumerable in ACPI environment")

To clarify, for the UP2 board we don't actually need this patch as we
have an ACPI _HID - just thought it would might be an improvement for
others.

I'll improve the description and perhaps reorder this patch last for v2.
Or I can send separately if you prefer.

Thanks for your review!
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jonathan Cameron April 24, 2018, 5:23 p.m. UTC | #3
On Sat, 21 Apr 2018 21:41:57 +0100
Javier Arteaga <javier@emutex.com> wrote:

> Hi Jonathan,
> 
> On Sat, Apr 21, 2018 at 04:54:41PM +0100, Jonathan Cameron wrote:
> > I don't really see the connection between the change in here
> > and what the description says...  
> 
> I think you're right, we didn't make our intent clear here.
> 
> > If you are probing from ACPI then there is no need to ensure
> > a valid of table is supplied (even if we aren't building with OF)
> > which is what I think this patch is trying to do...  
> 
> The patch enables ACPI _DSD to reuse existing DT "compatible" strings,
> as described in Documentation/acpi/enumeration.txt, even without OF.
> This kind of patch has some precedent, like for example:
> 
>     01427fe7c4b9 ("Input: adxl34x - make it enumerable in ACPI environment")
> 
> To clarify, for the UP2 board we don't actually need this patch as we
> have an ACPI _HID - just thought it would might be an improvement for
> others.
> 
> I'll improve the description and perhaps reorder this patch last for v2.
> Or I can send separately if you prefer.
> 
> Thanks for your review!
Unless we know of ACPI firmwares out there that are doing this, drop the
patch for now.  I don't want to see a flood of these based on a 'you can
do it that' way argument.

Jonathan

> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Javier Arteaga April 24, 2018, 7:33 p.m. UTC | #4
On Tue, Apr 24, 2018 at 06:23:30PM +0100, Jonathan Cameron wrote:
> Unless we know of ACPI firmwares out there that are doing this, drop the
> patch for now.  I don't want to see a flood of these based on a 'you can
> do it that' way argument.

Fair enough. I'll drop it for v3.
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s052.c
index 7cf39b3e2416..56ec04d1c68f 100644
--- a/drivers/iio/adc/ti-adc128s052.c
+++ b/drivers/iio/adc/ti-adc128s052.c
@@ -202,7 +202,7 @@  MODULE_DEVICE_TABLE(spi, adc128_id);
 static struct spi_driver adc128_driver = {
 	.driver = {
 		.name = "adc128s052",
-		.of_match_table = of_match_ptr(adc128_of_match),
+		.of_match_table = adc128_of_match,
 	},
 	.probe = adc128_probe,
 	.remove = adc128_remove,