From patchwork Thu Sep 10 17:32:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768409 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 71D8B698 for ; Thu, 10 Sep 2020 17:40:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5169321582 for ; Thu, 10 Sep 2020 17:40:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759626; bh=SECXsoDEgSc+XnHOLSKBHuHxcn/IbMqNxylG4VrCopc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=DQuwnqgxDNDBhzs2Gfy0htIF5R4ceH8wH605TQ4gn/y1Z8lb8lXQ9iyuBvzO6/lcw pCU22hkd77fpTNpPqHAYLwFsLKJruA+eZzQbhy+Oofoh1gQBKR5VOsqdX5Jwm5tMxk Kxzs1tFeeRa6aHCePyLZnCRykMl8AaCi+RvktDXg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725877AbgIJRkU (ORCPT ); Thu, 10 Sep 2020 13:40:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:47470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727070AbgIJRfO (ORCPT ); Thu, 10 Sep 2020 13:35:14 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5D888214F1; Thu, 10 Sep 2020 17:35:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759313; bh=SECXsoDEgSc+XnHOLSKBHuHxcn/IbMqNxylG4VrCopc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Uv7rV9Sha8k3/Qp+QqYqPQ+QOPBmm0eXfVxnvvtSV3DjrXGOunw2BcmEg4rDTGYYt EZ8PsopoC1+RWLLJFgcpEqwreayWin6L/GanS1omOwjsenHSokVi3WRJYt57yexuwi K0qPhBYsidHlta/lTPTa9PvchGQ1zBQXhWQFKEhU= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Phil Reid Subject: [PATCH 01/38] iio:potentiometer:ad5272: Drop of_match_ptr and CONFIG_OF protections. Date: Thu, 10 Sep 2020 18:32:05 +0100 Message-Id: <20200910173242.621168-2-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron These prevent use of this driver with ACPI via PRP0001 and are an example of an anti pattern I'm trying to remove from IIO. Drop them to remove this restriction. Also added mod_devicetable.h include given use of struct of_device_id which is defined in that header. Signed-off-by: Jonathan Cameron Cc: Phil Reid --- drivers/iio/potentiometer/ad5272.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/potentiometer/ad5272.c b/drivers/iio/potentiometer/ad5272.c index 933afcf7e925..70c45d346df0 100644 --- a/drivers/iio/potentiometer/ad5272.c +++ b/drivers/iio/potentiometer/ad5272.c @@ -15,6 +15,7 @@ #include #include #include +#include #define AD5272_RDAC_WR 1 #define AD5272_RDAC_RD 2 @@ -192,7 +193,6 @@ static int ad5272_probe(struct i2c_client *client, return devm_iio_device_register(dev, indio_dev); } -#if defined(CONFIG_OF) static const struct of_device_id ad5272_dt_ids[] = { { .compatible = "adi,ad5272-020", .data = (void *)AD5272_020 }, { .compatible = "adi,ad5272-050", .data = (void *)AD5272_050 }, @@ -202,7 +202,6 @@ static const struct of_device_id ad5272_dt_ids[] = { {} }; MODULE_DEVICE_TABLE(of, ad5272_dt_ids); -#endif /* CONFIG_OF */ static const struct i2c_device_id ad5272_id[] = { { "ad5272-020", AD5272_020 }, @@ -217,7 +216,7 @@ MODULE_DEVICE_TABLE(i2c, ad5272_id); static struct i2c_driver ad5272_driver = { .driver = { .name = "ad5272", - .of_match_table = of_match_ptr(ad5272_dt_ids), + .of_match_table = ad5272_dt_ids, }, .probe = ad5272_probe, .id_table = ad5272_id, From patchwork Thu Sep 10 17:32:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768405 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 547B4698 for ; Thu, 10 Sep 2020 17:40:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 307F321582 for ; Thu, 10 Sep 2020 17:40:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759620; bh=DjKbbIEswiwrtvBGeoLq8O77Wpmcy9kPjofN8C1Cx6U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Jjr5cQ9GTSLGWXlUpTR+P8/8xVnTPl6qR/pbQLmLna4aLqOzb2p0fPOp4rPMl6dQa tMX4Un2ekYR1VjB+OVlrNw47+meIGAkKM/J96Y4zn1CYSE/XZ707v1f+TP10035yTm /QfE65Y7790kvPj9d55e8Sv8steZf6LyLXuZUjDc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726612AbgIJRkR (ORCPT ); Thu, 10 Sep 2020 13:40:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:47478 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727085AbgIJRfP (ORCPT ); Thu, 10 Sep 2020 13:35:15 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A980421D79; Thu, 10 Sep 2020 17:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759314; bh=DjKbbIEswiwrtvBGeoLq8O77Wpmcy9kPjofN8C1Cx6U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s0PkrW9wBllEu5ZgFP0wd4TYxipZ+WAUP1uHBY8qUD+jk/P+POm14ag5H7kIkXRiH 5vUIqBB1vWyT/qb8lVcivkpvvzLqrHKq1YufgXB6IVmRyI0O1FLN/myjCmidjl1WZW JKiJPvES+D6NrNA0nNFskjFkNdy6RuXmEKIPnxPY= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Slawomir Stepien Subject: [PATCH 02/38] iio:potentiometer:ds1803: Drop of_match_ptr and CONFIG_OF protections Date: Thu, 10 Sep 2020 18:32:06 +0100 Message-Id: <20200910173242.621168-3-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron These prevent use of this driver with ACPI via PRP0001 and are an example of an anti pattern I'm trying to remove from IIO. Drop them to remove this restriction. Also switch of.h for mod_devicetable.h include given use of struct of_device_id which is defined in that header. Signed-off-by: Jonathan Cameron Cc: Slawomir Stepien --- drivers/iio/potentiometer/ds1803.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iio/potentiometer/ds1803.c b/drivers/iio/potentiometer/ds1803.c index 5c061ab8f46c..20b45407eaac 100644 --- a/drivers/iio/potentiometer/ds1803.c +++ b/drivers/iio/potentiometer/ds1803.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #define DS1803_MAX_POS 255 #define DS1803_WRITE(chan) (0xa8 | ((chan) + 1)) @@ -134,7 +134,6 @@ static int ds1803_probe(struct i2c_client *client, return devm_iio_device_register(dev, indio_dev); } -#if defined(CONFIG_OF) static const struct of_device_id ds1803_dt_ids[] = { { .compatible = "maxim,ds1803-010", .data = &ds1803_cfg[DS1803_010] }, { .compatible = "maxim,ds1803-050", .data = &ds1803_cfg[DS1803_050] }, @@ -142,7 +141,6 @@ static const struct of_device_id ds1803_dt_ids[] = { {} }; MODULE_DEVICE_TABLE(of, ds1803_dt_ids); -#endif /* CONFIG_OF */ static const struct i2c_device_id ds1803_id[] = { { "ds1803-010", DS1803_010 }, @@ -155,7 +153,7 @@ MODULE_DEVICE_TABLE(i2c, ds1803_id); static struct i2c_driver ds1803_driver = { .driver = { .name = "ds1803", - .of_match_table = of_match_ptr(ds1803_dt_ids), + .of_match_table = ds1803_dt_ids, }, .probe = ds1803_probe, .id_table = ds1803_id, From patchwork Thu Sep 10 17:32:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768403 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1962F698 for ; Thu, 10 Sep 2020 17:40:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA2F921582 for ; Thu, 10 Sep 2020 17:40:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759619; bh=GxZXgF6f/3dyZnrz6XrKc4XzhvZ3y+tvtUmumqeMtDE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=puzmeFl56vdvUVos60Agbm+64Bh+CJfyUU4hSJMTjSN3dt4dTz/Bx4fWtblL4v3Jx gm/OXY5thEhhbHuhk3whzdTFmtsrG0Gt6U4VoYkU2y0WusAdiU3ion87pLRlHjUoRZ L0AkkDJWxFcmjdEoVR4ZEO93AEe8JMohw45UPs7Q= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726947AbgIJRkO (ORCPT ); Thu, 10 Sep 2020 13:40:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:47488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726612AbgIJRf2 (ORCPT ); Thu, 10 Sep 2020 13:35:28 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0EBF121D81; Thu, 10 Sep 2020 17:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759316; bh=GxZXgF6f/3dyZnrz6XrKc4XzhvZ3y+tvtUmumqeMtDE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P9i4d4Pr33GCdHgaZApLs8ovxNptKI4GN59SEoSzLP4nFlYJ59C7UVm0BZsTh/11p Yl/+1cDGLEN4h3VehYbCfjGACt+wcIj+XmRBvDIxBJF1vm1awVLNGpsb9587RFgSA0 +o9oTWZ6nTphPn5AoCVW7UXtXVsFsl9n8Vg0rvUE= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Martin Kaiser Subject: [PATCH 03/38] iio:potentiometer:max5432: Drop of_match_ptr and use generic fw accessors Date: Thu, 10 Sep 2020 18:32:07 +0100 Message-Id: <20200910173242.621168-4-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron These prevent use of this driver with ACPI via PRP0001 and are an example of an anti pattern I'm trying to remove from IIO. Drop them to remove this restriction. Also switch headers to reflect this change. Signed-off-by: Jonathan Cameron Cc: Martin Kaiser Reviewed-by: Martin Kaiser --- drivers/iio/potentiometer/max5432.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iio/potentiometer/max5432.c b/drivers/iio/potentiometer/max5432.c index 280de9c54471..aed3b6ab82a2 100644 --- a/drivers/iio/potentiometer/max5432.c +++ b/drivers/iio/potentiometer/max5432.c @@ -11,8 +11,8 @@ #include #include #include -#include -#include +#include +#include /* All chip variants have 32 wiper positions. */ #define MAX5432_MAX_POS 31 @@ -100,7 +100,7 @@ static int max5432_probe(struct i2c_client *client, data = iio_priv(indio_dev); data->client = client; - data->ohm = (unsigned long)of_device_get_match_data(dev); + data->ohm = (unsigned long)device_get_match_data(dev); indio_dev->info = &max5432_info; indio_dev->channels = max5432_channels; @@ -122,7 +122,7 @@ MODULE_DEVICE_TABLE(of, max5432_dt_ids); static struct i2c_driver max5432_driver = { .driver = { .name = "max5432", - .of_match_table = of_match_ptr(max5432_dt_ids), + .of_match_table = max5432_dt_ids, }, .probe = max5432_probe, }; From patchwork Thu Sep 10 17:32:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768401 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C20D4698 for ; Thu, 10 Sep 2020 17:40:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A0E3321D40 for ; Thu, 10 Sep 2020 17:40:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759615; bh=YS4gAiSw2mEy2kXOy+RZEFyGI5yFPZtd5djTX23+YXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KJsqzBJL6jlplpyFzKVOCZ0Qgd+FX6JNUqjbo3Hb54JBkl3wQRSvUXEzRy6xCVF1x lV/DjO7nBKdY55IxY6Q9GsgLD50zyCmFsY8Nm1PSreEOrhZEpqXJ4yrkLTys9hBOWe cUx2cMwE6WxUW/4upWlnd/capDai2w8XtpHojqx0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726853AbgIJRkN (ORCPT ); Thu, 10 Sep 2020 13:40:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:47772 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727083AbgIJRfs (ORCPT ); Thu, 10 Sep 2020 13:35:48 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6220221D90; Thu, 10 Sep 2020 17:35:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759317; bh=YS4gAiSw2mEy2kXOy+RZEFyGI5yFPZtd5djTX23+YXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jF8OtCoPPikHeHfTGm9bFj6BoyDMXVdGE2HfqrpFStlbYIFneN48HkyJCobfhrg5K WmFQjonOyRh0ML3zFwy12fnnFcr7/99A26jl5y3A0qAXz8m1Qh5mwwKJKs5n6uIE47 EwBL1H2XLpEs2xYC3SwyYJt8JodlJyhFpU0LHGQU= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Maury Anderson , Matthew Weber , Slawomir Stepien Subject: [PATCH 04/38] iio:potentiometer:max5481: Drop of_match_ptr and CONFIG_OF protections. Date: Thu, 10 Sep 2020 18:32:08 +0100 Message-Id: <20200910173242.621168-5-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron These prevent use of this driver with ACPI via PRP0001 and are an example of an anti pattern I'm trying to remove from IIO. Whilst this driver has an ACPI binding, it is not of a form that is valid under ACPI so will be dropped shortly. Also switch to device_get_match_data() and switch headers. Signed-off-by: Jonathan Cameron Cc: Maury Anderson Cc: Matthew Weber Cc: Slawomir Stepien --- drivers/iio/potentiometer/max5481.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/iio/potentiometer/max5481.c b/drivers/iio/potentiometer/max5481.c index 5f5988189796..6d1e1a57cba1 100644 --- a/drivers/iio/potentiometer/max5481.c +++ b/drivers/iio/potentiometer/max5481.c @@ -11,8 +11,8 @@ #include #include #include -#include -#include +#include +#include #include /* write wiper reg */ @@ -117,7 +117,6 @@ static const struct iio_info max5481_info = { .write_raw = max5481_write_raw, }; -#if defined(CONFIG_OF) static const struct of_device_id max5481_match[] = { { .compatible = "maxim,max5481", .data = &max5481_cfg[max5481] }, { .compatible = "maxim,max5482", .data = &max5481_cfg[max5482] }, @@ -126,7 +125,6 @@ static const struct of_device_id max5481_match[] = { { } }; MODULE_DEVICE_TABLE(of, max5481_match); -#endif static int max5481_probe(struct spi_device *spi) { @@ -144,7 +142,7 @@ static int max5481_probe(struct spi_device *spi) data->spi = spi; - data->cfg = of_device_get_match_data(&spi->dev); + data->cfg = device_get_match_data(&spi->dev); if (!data->cfg) data->cfg = &max5481_cfg[id->driver_data]; @@ -198,7 +196,7 @@ MODULE_DEVICE_TABLE(acpi, max5481_acpi_match); static struct spi_driver max5481_driver = { .driver = { .name = "max5481", - .of_match_table = of_match_ptr(max5481_match), + .of_match_table = max5481_match, .acpi_match_table = ACPI_PTR(max5481_acpi_match), }, .probe = max5481_probe, From patchwork Thu Sep 10 17:32:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768399 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A314914F6 for ; Thu, 10 Sep 2020 17:40:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 80EFD21D81 for ; Thu, 10 Sep 2020 17:40:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759613; bh=bNmhDRiZo3c3p++zFV+W+5Voj9Iev+vd6lt+Nd7U4hc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=TjsImStu4DmM2fQIJvZ8wXzWxSVZdzmE9sHOKmyc14+8bYAXy392273Y45XDcYgf8 zBUA38dMIKO+39QPEdvfyNtwZ4pxhXHgz4XzLhxvp8MzK9aPpSiN0rrWJtaQH4jYSL KopzkBEw9ChBWBUZ56UyL9op5vzd2Lb7M9RvG0Cs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726997AbgIJRkM (ORCPT ); Thu, 10 Sep 2020 13:40:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:47774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726947AbgIJRfs (ORCPT ); Thu, 10 Sep 2020 13:35:48 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1B81221D92; Thu, 10 Sep 2020 17:35:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759319; bh=bNmhDRiZo3c3p++zFV+W+5Voj9Iev+vd6lt+Nd7U4hc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bvu2moA8fF2HVqw4mz45yQmF0LgnddR7/DyCGqiLGiycrQrx194NnZUywaPqgYerk W3A65sQEhD0pMXZZ2umgownvGalhzQxtfggySyO60f7JZXhXVb4SIiHSGQ/0P746bD DCBjKBOFGqzaX6fTzbwrNoySGONdPEnTjZNFoZdI= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Maury Anderson , Matthew Weber , Slawomir Stepien Subject: [PATCH 05/38] iio:potentiometer:max5481: Drop invalid ACPI binding. Date: Thu, 10 Sep 2020 18:32:09 +0100 Message-Id: <20200910173242.621168-6-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron Given that an ACPI binding must start with 3 or 4 capitals, this cannot represent a valid binding. It seems unlikely anything out there is using it. Signed-off-by: Jonathan Cameron Cc: Maury Anderson Cc: Matthew Weber Cc: Slawomir Stepien --- drivers/iio/potentiometer/max5481.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/drivers/iio/potentiometer/max5481.c b/drivers/iio/potentiometer/max5481.c index 6d1e1a57cba1..a88ed0eb3adc 100644 --- a/drivers/iio/potentiometer/max5481.c +++ b/drivers/iio/potentiometer/max5481.c @@ -7,7 +7,6 @@ * https://datasheets.maximintegrated.com/en/ds/MAX5481-MAX5484.pdf */ -#include #include #include #include @@ -182,22 +181,10 @@ static const struct spi_device_id max5481_id_table[] = { }; MODULE_DEVICE_TABLE(spi, max5481_id_table); -#if defined(CONFIG_ACPI) -static const struct acpi_device_id max5481_acpi_match[] = { - { "max5481", max5481 }, - { "max5482", max5482 }, - { "max5483", max5483 }, - { "max5484", max5484 }, - { } -}; -MODULE_DEVICE_TABLE(acpi, max5481_acpi_match); -#endif - static struct spi_driver max5481_driver = { .driver = { .name = "max5481", .of_match_table = max5481_match, - .acpi_match_table = ACPI_PTR(max5481_acpi_match), }, .probe = max5481_probe, .remove = max5481_remove, From patchwork Thu Sep 10 17:32:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768323 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7197F16C0 for ; Thu, 10 Sep 2020 17:36:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4D08D221E5 for ; Thu, 10 Sep 2020 17:36:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759412; bh=y4RBhMExWqZsbDmxczqshbG9Lc9AJxW8KSELyxL6VRk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=vWLJ4G0OR3Jh7LH+zvrsnDPCJUyWkbBR36el2TBEIx2BGOTrKW1wMBrgSohVRu8a5 QOCYZ0TaLxOaDITbg09gmoYoZW18zUw0WPclu8qmfL181IqjKa5mMF4XpW7ZmMF9UV EpYsPCuqB15WeAMdfjZYlJiYTf/LOM2rP1fJ0Kys= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727825AbgIJRgX (ORCPT ); Thu, 10 Sep 2020 13:36:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:47866 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727101AbgIJRfs (ORCPT ); Thu, 10 Sep 2020 13:35:48 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C21F8221E3; Thu, 10 Sep 2020 17:35:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759320; bh=y4RBhMExWqZsbDmxczqshbG9Lc9AJxW8KSELyxL6VRk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OHKWdpXcOjJyEatjyckdI8lDGFNPo19n4c/Y53y89YZJuQLi6N9f7FrygX32GD9oM JtGguuq4Vn18IarrDK3vc6u/BXzNbVs6YOPIhzXILbnuCI2TKcnRnd4RJ08UZ+W+TK o+7XkJR98wUCmTdmd2k0WU1TFevHJ3IzSrwJ4HGk= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Peter Rosin Subject: [PATCH 06/38] iio:potentiometer:mcp4018: Drop of_match_ptr and CONFIG_OF protections. Date: Thu, 10 Sep 2020 18:32:10 +0100 Message-Id: <20200910173242.621168-7-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron These prevent use of this driver with ACPI via PRP0001 and are an example of an anti pattern I'm trying to remove from IIO. Also use device_get_match_data() rather than devicetree only version. Signed-off-by: Jonathan Cameron Cc: Peter Rosin --- drivers/iio/potentiometer/mcp4018.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/iio/potentiometer/mcp4018.c b/drivers/iio/potentiometer/mcp4018.c index fd0579ad3c83..c0e171fec062 100644 --- a/drivers/iio/potentiometer/mcp4018.c +++ b/drivers/iio/potentiometer/mcp4018.c @@ -16,8 +16,8 @@ #include #include #include -#include -#include +#include +#include #define MCP4018_WIPER_MAX 127 @@ -116,8 +116,6 @@ static const struct i2c_device_id mcp4018_id[] = { }; MODULE_DEVICE_TABLE(i2c, mcp4018_id); -#ifdef CONFIG_OF - #define MCP4018_COMPATIBLE(of_compatible, cfg) { \ .compatible = of_compatible, \ .data = &mcp4018_cfg[cfg], \ @@ -140,8 +138,6 @@ static const struct of_device_id mcp4018_of_match[] = { }; MODULE_DEVICE_TABLE(of, mcp4018_of_match); -#endif - static int mcp4018_probe(struct i2c_client *client) { struct device *dev = &client->dev; @@ -161,7 +157,7 @@ static int mcp4018_probe(struct i2c_client *client) i2c_set_clientdata(client, indio_dev); data->client = client; - data->cfg = of_device_get_match_data(dev); + data->cfg = device_get_match_data(dev); if (!data->cfg) data->cfg = &mcp4018_cfg[i2c_match_id(mcp4018_id, client)->driver_data]; @@ -176,7 +172,7 @@ static int mcp4018_probe(struct i2c_client *client) static struct i2c_driver mcp4018_driver = { .driver = { .name = "mcp4018", - .of_match_table = of_match_ptr(mcp4018_of_match), + .of_match_table = mcp4018_of_match, }, .probe_new = mcp4018_probe, .id_table = mcp4018_id, From patchwork Thu Sep 10 17:32:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768397 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 773C8139F for ; Thu, 10 Sep 2020 17:40:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5637321D40 for ; Thu, 10 Sep 2020 17:40:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759613; bh=M/iE5ajFvegSF/+ggOtfuNwaDIQiCxRk1KTcjv3rSTU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=VXOLcevGfMYNhtsjwiw321t3v/1rSM45AJ7BPzt8W/BX38M5QCNM4gvKtli3ejaNX ETa5VUPNtb59y9JWNzjwRacWtT1K/mTMrwwVs5+maYshmY74445nZyQYqVdNK3+kmd pTKWmWfehH8EKJ2/9o14a5jfMJAzQ6uUGiCRuJdc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726967AbgIJRkL (ORCPT ); Thu, 10 Sep 2020 13:40:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:47868 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726997AbgIJRfs (ORCPT ); Thu, 10 Sep 2020 13:35:48 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 238DE221E2; Thu, 10 Sep 2020 17:35:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759322; bh=M/iE5ajFvegSF/+ggOtfuNwaDIQiCxRk1KTcjv3rSTU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wiQpEgKttba7jmiNHLm2XFAQBEyDg8p3rqcVUaxEZ2fvZTgcyiAPdNB9dY3QeI5TJ 2wqZXVqsynV6sQp2juGzX5nJ3u14EgjHPgW8fek45Rr7bTDTnh9uoPwmahgpuxEBMY yDOzAUoPfuNatfz18eXQWE9+OMd0jRub2idg+uf0= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Slawomir Stepien Subject: [PATCH 07/38] iio:potentiometer:mcp4131: Drop of_match_ptr and use generic fw interfaces. Date: Thu, 10 Sep 2020 18:32:11 +0100 Message-Id: <20200910173242.621168-8-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This change allows the use of the driver with ACPI via PRP0001 and remove an example of an anti pattern I'm trying to remove from IIO. Also adjust includes to reflect this change. Signed-off-by: Jonathan Cameron Cc: Slawomir Stepien --- drivers/iio/potentiometer/mcp4131.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iio/potentiometer/mcp4131.c b/drivers/iio/potentiometer/mcp4131.c index 2923ce250fc3..7c8c18ab8764 100644 --- a/drivers/iio/potentiometer/mcp4131.c +++ b/drivers/iio/potentiometer/mcp4131.c @@ -37,9 +37,9 @@ #include #include #include +#include #include -#include -#include +#include #include #define MCP4131_WRITE (0x00 << 2) @@ -252,7 +252,7 @@ static int mcp4131_probe(struct spi_device *spi) data = iio_priv(indio_dev); spi_set_drvdata(spi, indio_dev); data->spi = spi; - data->cfg = of_device_get_match_data(&spi->dev); + data->cfg = device_get_match_data(&spi->dev); if (!data->cfg) { devid = spi_get_device_id(spi)->driver_data; data->cfg = &mcp4131_cfg[devid]; @@ -479,7 +479,7 @@ MODULE_DEVICE_TABLE(spi, mcp4131_id); static struct spi_driver mcp4131_driver = { .driver = { .name = "mcp4131", - .of_match_table = of_match_ptr(mcp4131_dt_ids), + .of_match_table = mcp4131_dt_ids, }, .probe = mcp4131_probe, .id_table = mcp4131_id, From patchwork Thu Sep 10 17:32:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768335 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2266C698 for ; Thu, 10 Sep 2020 17:37:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ED8EA221E3 for ; Thu, 10 Sep 2020 17:37:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759449; bh=bsUsUZ5Fif7XK+Uhi90Bir1D/WKFHq+PYWLaPVSxvhQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=qwVWfs58BKAJD3nOpN/1MVm/Y9z7KtrD2WEZxj6vbNDmwDXwfLHzeFlArVwYmi2MT RHJsVVwrOf/whVG4E3xjFj69u7ONlnoX6a/IYE9p5Tw7T9WRN7jtS/XCZmcahflEP2 5cyMcpGofcl8EfP4eMHIbfVB+QWK9iaQHFgHlZco= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727027AbgIJRhY (ORCPT ); Thu, 10 Sep 2020 13:37:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:47892 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727113AbgIJRgA (ORCPT ); Thu, 10 Sep 2020 13:36:00 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 75027221E7; Thu, 10 Sep 2020 17:35:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759323; bh=bsUsUZ5Fif7XK+Uhi90Bir1D/WKFHq+PYWLaPVSxvhQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PuoJ6FjbRmafkcS8FYfDLWniwcHKiWrMFgOrHx77GVZ6HQhovHPIabzwYCYCwSsg8 lx2ucFTve4YZ3T7zZza5KlPW9WEj3qtOjgoM84o7RFBSbYtfkNX6BMj2jLOw/IJp6g qjI0Fzk+2ZfPecTaHHgY0uXsl9oRBuCUZ89ODW9s= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Peter Rosin Subject: [PATCH 08/38] iio:potentiometer:mcp4531: Drop of_match_ptr and CONFIG_OF protections. Date: Thu, 10 Sep 2020 18:32:12 +0100 Message-Id: <20200910173242.621168-9-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron These prevent use of this driver with ACPI via PRP0001 and are an example of an anti pattern I'm trying to remove from IIO. Hence drop them from this driver. Also switch to device_get_match_data() from of_ variant and adjust headers to reflect the change. Signed-off-by: Jonathan Cameron Cc: Peter Rosin --- drivers/iio/potentiometer/mcp4531.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/iio/potentiometer/mcp4531.c b/drivers/iio/potentiometer/mcp4531.c index 95efc4b40514..c25f84b4a270 100644 --- a/drivers/iio/potentiometer/mcp4531.c +++ b/drivers/iio/potentiometer/mcp4531.c @@ -28,8 +28,8 @@ #include #include #include -#include -#include +#include +#include #include @@ -275,8 +275,6 @@ static const struct i2c_device_id mcp4531_id[] = { }; MODULE_DEVICE_TABLE(i2c, mcp4531_id); -#ifdef CONFIG_OF - #define MCP4531_COMPATIBLE(of_compatible, cfg) { \ .compatible = of_compatible, \ .data = &mcp4531_cfg[cfg], \ @@ -350,7 +348,6 @@ static const struct of_device_id mcp4531_of_match[] = { { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, mcp4531_of_match); -#endif static int mcp4531_probe(struct i2c_client *client) { @@ -371,7 +368,7 @@ static int mcp4531_probe(struct i2c_client *client) i2c_set_clientdata(client, indio_dev); data->client = client; - data->cfg = of_device_get_match_data(dev); + data->cfg = device_get_match_data(dev); if (!data->cfg) data->cfg = &mcp4531_cfg[i2c_match_id(mcp4531_id, client)->driver_data]; @@ -386,7 +383,7 @@ static int mcp4531_probe(struct i2c_client *client) static struct i2c_driver mcp4531_driver = { .driver = { .name = "mcp4531", - .of_match_table = of_match_ptr(mcp4531_of_match), + .of_match_table = mcp4531_of_match, }, .probe_new = mcp4531_probe, .id_table = mcp4531_id, From patchwork Thu Sep 10 17:32:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768329 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F3953139F for ; Thu, 10 Sep 2020 17:37:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CF940221E5 for ; Thu, 10 Sep 2020 17:37:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759430; bh=MhAGlqNSuC/0Tfio5H1H+dnSh4Jr34KByms28bDFvHg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=NrkegUAPEwFTftGVo3P16cCqR4TSreFHeP5EgkV91hs2fOE1oyas+GuBK5ElhT4hs PaK4xigL6c/e0Txq7rjtx6ZA8zj7vt1Ml30Clll4NrTMfkOOQYYmidygmve+cmCUTU TOIirNfxU+++T5G/NB03sAy2YQEyrejgOgqFxaCg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726992AbgIJRhD (ORCPT ); Thu, 10 Sep 2020 13:37:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:47894 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727109AbgIJRgA (ORCPT ); Thu, 10 Sep 2020 13:36:00 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CC7A8221E5; Thu, 10 Sep 2020 17:35:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759324; bh=MhAGlqNSuC/0Tfio5H1H+dnSh4Jr34KByms28bDFvHg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lMDkqL5kTds1YDkaXt4KocfLKid7MYgejane4A4b2pOfnPYfSqiOHTww0oOkm3leQ JSLvnYpXVl3x1OysqOOkuPR8RS7Ss7wVXPPZovm4DiD3Z+FB52Cj48OnY3l5AaIlNx KG/97cRCesdJDdUB8jhrSXj5+3Avht2kKJHxGzW4= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Michael Hennerich Subject: [PATCH 09/38] iio:dac:ad5446: Drop of_match_ptr and CONFIG_OF protections Date: Thu, 10 Sep 2020 18:32:13 +0100 Message-Id: <20200910173242.621168-10-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron These prevent use of this driver with ACPI via PRP0001 and are an example of an anti pattern I'm trying to remove from IIO. Hence drop them from this driver. Signed-off-by: Jonathan Cameron Cc: Michael Hennerich --- drivers/iio/dac/ad5446.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/dac/ad5446.c b/drivers/iio/dac/ad5446.c index 935a6177569f..d87e21016863 100644 --- a/drivers/iio/dac/ad5446.c +++ b/drivers/iio/dac/ad5446.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -478,13 +479,11 @@ static const struct spi_device_id ad5446_spi_ids[] = { }; MODULE_DEVICE_TABLE(spi, ad5446_spi_ids); -#ifdef CONFIG_OF static const struct of_device_id ad5446_of_ids[] = { { .compatible = "ti,dac7512" }, { } }; MODULE_DEVICE_TABLE(of, ad5446_of_ids); -#endif static int ad5446_spi_probe(struct spi_device *spi) { @@ -502,7 +501,7 @@ static int ad5446_spi_remove(struct spi_device *spi) static struct spi_driver ad5446_spi_driver = { .driver = { .name = "ad5446", - .of_match_table = of_match_ptr(ad5446_of_ids), + .of_match_table = ad5446_of_ids, }, .probe = ad5446_spi_probe, .remove = ad5446_spi_remove, From patchwork Thu Sep 10 17:32:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768333 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 67FEE139F for ; Thu, 10 Sep 2020 17:37:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4DD87221E3 for ; Thu, 10 Sep 2020 17:37:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759448; bh=k5O5fxDeVOF9kbZT8cjykqnn4ZZJrkgdMlN2nKk8PV0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Plw/BwsUFeBn3IlC6CSp+JnKJ9gi9KD+VOtdIAKWwSIHCAKN80pbsD/RwCP5z1dv6 0d9qw2NtguKh6S/794axWnO1K7B5fZLr5H6eGn6NLvuCHEywY8mAH49NwMzyG168z8 2wY7WugR1hrLtNALJmp/NAzqe2xsvT/UFqIGuuQw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726911AbgIJRhX (ORCPT ); Thu, 10 Sep 2020 13:37:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:47926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727027AbgIJRgA (ORCPT ); Thu, 10 Sep 2020 13:36:00 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2A998221EA; Thu, 10 Sep 2020 17:35:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759326; bh=k5O5fxDeVOF9kbZT8cjykqnn4ZZJrkgdMlN2nKk8PV0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AmHv+g7umKFjEgEUu7e+qSGENa/d9waGtYRV9aOmA7U3pBFV89kKWSXDAQ++wGgZz cgMcozOC+j3B4/u0NtPB9rGRLnXoE5yrrdN5ifJfH+CDCmroX3T/0cqm07szvWL3xe WgxDL0bBtnRoHFe0KnlmC9pPiXZIHPKO0mXIpuX8= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Michael Hennerich , Lars-Peter Clausen Subject: [PATCH 10/38] iio:dac:ad5592r: Drop of_match_ptr and ACPI_PTR protections. Date: Thu, 10 Sep 2020 18:32:14 +0100 Message-Id: <20200910173242.621168-11-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron These result in a very small reduction in driver size, but at the cost of more complex build and slightly harder to read code. In the case of of_match_ptr it also prevents use of PRP0001 ACPI based identification. In this particular case we have a valid ACPI/PNP ID that I am assuming was issued by Analog Devices. That should be used in preference to PRP0001 but doesn't mean we should prevent that route. Signed-off-by: Jonathan Cameron Cc: Michael Hennerich Cc: Lars-Peter Clausen --- drivers/iio/dac/ad5592r.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/iio/dac/ad5592r.c b/drivers/iio/dac/ad5592r.c index 49308ad13c4b..41f651500668 100644 --- a/drivers/iio/dac/ad5592r.c +++ b/drivers/iio/dac/ad5592r.c @@ -10,9 +10,8 @@ #include #include -#include +#include #include -#include #define AD5592R_GPIO_READBACK_EN BIT(10) #define AD5592R_LDAC_READBACK_EN BIT(6) @@ -157,8 +156,8 @@ MODULE_DEVICE_TABLE(acpi, ad5592r_acpi_match); static struct spi_driver ad5592r_spi_driver = { .driver = { .name = "ad5592r", - .of_match_table = of_match_ptr(ad5592r_of_match), - .acpi_match_table = ACPI_PTR(ad5592r_acpi_match), + .of_match_table = ad5592r_of_match, + .acpi_match_table = ad5592r_acpi_match, }, .probe = ad5592r_spi_probe, .remove = ad5592r_spi_remove, From patchwork Thu Sep 10 17:32:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768331 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2F83A139F for ; Thu, 10 Sep 2020 17:37:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 14158221E5 for ; Thu, 10 Sep 2020 17:37:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759444; bh=CRftnf93UBEo/s7JDiAnvNGiFqR8SiJ2dP8aIvcvte8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=bPEcuAiN4SI6pHJ8QB6FwALdPLXfPW3hhxH0diXtmXh4zd+4YKxb2io677O/Faq8u PG88rMSHEDHbZzj27ZNhF6Bq654fwi4D+WPpZpiWBsGHiMoi4fshYzQ16pxpuwf1su D53leEHJS3ShDcukvPikiXOt52/pcsdy3eIVPAjE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727794AbgIJRhP (ORCPT ); Thu, 10 Sep 2020 13:37:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:47928 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725965AbgIJRgA (ORCPT ); Thu, 10 Sep 2020 13:36:00 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AEA82221ED; Thu, 10 Sep 2020 17:35:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759327; bh=CRftnf93UBEo/s7JDiAnvNGiFqR8SiJ2dP8aIvcvte8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EIzIwNbsy1gsD4uUOuGlOdK2PJYAFZ9TviwKTqqatQBGy8Pk5rkUT7wjqSwlqifLe +Ot7twcchwx517OM8hKdsNtqqtk1ov8FdYwBqcFBSPUiRvyh8kVcGRaWFmf77bD55W bU07m5Dvd9SHU/6wq0efVpS/lda7LKZsNjD2qVlw= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Michael Hennerich , Lars-Peter Clausen Subject: [PATCH 11/38] iio:dac:ad5593r: Drop of_match_ptr and ACPI_PTR protections. Date: Thu, 10 Sep 2020 18:32:15 +0100 Message-Id: <20200910173242.621168-12-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron These result in a very small reduction in driver size, but at the cost of more complex build and slightly harder to read code. In the case of of_match_ptr it also prevents use of PRP0001 ACPI based identification. In this particular case we have a valid ACPI/PNP ID that I am assuming was issued by Analog Devices. That should be used in preference to PRP0001 but doesn't mean we should prevent that route. Signed-off-by: Jonathan Cameron Cc: Michael Hennerich Cc: Lars-Peter Clausen --- drivers/iio/dac/ad5593r.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/iio/dac/ad5593r.c b/drivers/iio/dac/ad5593r.c index 1fbe9c019c7f..5b4df36fdc2a 100644 --- a/drivers/iio/dac/ad5593r.c +++ b/drivers/iio/dac/ad5593r.c @@ -11,8 +11,7 @@ #include #include #include -#include -#include +#include #define AD5593R_MODE_CONF (0 << 4) #define AD5593R_MODE_DAC_WRITE (1 << 4) @@ -124,8 +123,8 @@ MODULE_DEVICE_TABLE(acpi, ad5593r_acpi_match); static struct i2c_driver ad5593r_driver = { .driver = { .name = "ad5593r", - .of_match_table = of_match_ptr(ad5593r_of_match), - .acpi_match_table = ACPI_PTR(ad5593r_acpi_match), + .of_match_table = ad5593r_of_match, + .acpi_match_table = ad5593r_acpi_match, }, .probe = ad5593r_i2c_probe, .remove = ad5593r_i2c_remove, From patchwork Thu Sep 10 17:32:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768393 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A7563698 for ; Thu, 10 Sep 2020 17:40:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 86E2921D40 for ; Thu, 10 Sep 2020 17:40:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759611; bh=0gR9DbF4mOgfEbOg15URbOrD9gQ7vQCurGCJPF5Hz98=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=LJFLb8cV2t9HAASWF4fFA96dQJSvkwg9sWGvlyu0g+Zw4Etz+R/PN9dSOSNLEXuBF Vi6OXWY/3UkPMMymXEkEZrnFa81uu/LTRJghgKFF9tXbmnSP2lKadJyZUmckGIXX15 DNuQzuYc1JMY4cZ6oZ3uapqE6EdrlkiNE7LapN1E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726992AbgIJRkK (ORCPT ); Thu, 10 Sep 2020 13:40:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:47774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727095AbgIJRgA (ORCPT ); Thu, 10 Sep 2020 13:36:00 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2CFC9221EC; Thu, 10 Sep 2020 17:35:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759329; bh=0gR9DbF4mOgfEbOg15URbOrD9gQ7vQCurGCJPF5Hz98=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IgxNW9g9W5kvpE+R3ls5V8qs3KKQYa+7EHwFbAic23MAlgChb/ockX/L1FUPdKZif tvnZ2zdX3MouihUUF18MmwuF2+LyOXtoAx4q+YPGldZ9UfflQGU1WkxBCWIkrshMy7 JyNMZ5yLy6cqPLsH2w+DzWqE/TvJ39zXtusXJ5aI= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Michael Hennerich , Lars-Peter Clausen Subject: [PATCH 12/38] iio:dac:ad7303: Drop of_match_ptr protection Date: Thu, 10 Sep 2020 18:32:16 +0100 Message-Id: <20200910173242.621168-13-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This prevents use of this driver with ACPI via PRP0001 and are an example of an anti pattern I'm trying to remove from IIO. Also add mod_devicetable.h include given struct of_device_id is declared there. Signed-off-by: Jonathan Cameron Cc: Michael Hennerich Cc: Lars-Peter Clausen --- drivers/iio/dac/ad7303.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/dac/ad7303.c b/drivers/iio/dac/ad7303.c index 4460aa57a33f..20c85c2a636c 100644 --- a/drivers/iio/dac/ad7303.c +++ b/drivers/iio/dac/ad7303.c @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -287,7 +288,7 @@ MODULE_DEVICE_TABLE(spi, ad7303_spi_ids); static struct spi_driver ad7303_driver = { .driver = { .name = "ad7303", - .of_match_table = of_match_ptr(ad7303_spi_of_match), + .of_match_table = ad7303_spi_of_match, }, .probe = ad7303_probe, .remove = ad7303_remove, From patchwork Thu Sep 10 17:32:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768337 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D56DA139F for ; Thu, 10 Sep 2020 17:37:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B3533206A1 for ; Thu, 10 Sep 2020 17:37:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759468; bh=mgqvfp59U/VE518HLZVxRkDBS9RAo+t9gBat3CNe6bs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=i9qQ30pZLMYIN/KDG3zdCf9mAyKPInPEP2z90fSdLMUI6JU3V00zqIdeq6vaCs6vl pL8LbO+uiP4kO7Wh9uf1bQdVzQrqjSfPywTGRBtY+HbRsBf2IhqqEc6t2PlWPRSZbQ c6arPOFrpknHcFsEXVevYp/lS3qMX8pUihK9T+40= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727033AbgIJRhn (ORCPT ); Thu, 10 Sep 2020 13:37:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:47772 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727773AbgIJRgB (ORCPT ); Thu, 10 Sep 2020 13:36:01 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9BB73221EE; Thu, 10 Sep 2020 17:35:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759330; bh=mgqvfp59U/VE518HLZVxRkDBS9RAo+t9gBat3CNe6bs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iP9wwDTlY4OnOysAijJLCua7B4dJPuBRcgtTAP0xpkiklixH+lQzpJMtKn610aYrZ DmU3IhF+lSK76VsJdxOoaXGw9X8kds6qCU4GfKFdJI4WROfA3aZas/H2qUBXjRJlRE pnPd9IA+lNwtfK184mWGaC+Uj/QL/WOclvxui8hA= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Peter Meerwald Subject: [PATCH 13/38] iio:dac:mcp4725: drop of_match_ptr and use generic fw properties Date: Thu, 10 Sep 2020 18:32:17 +0100 Message-Id: <20200910173242.621168-14-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This enables use of ACPI PRP0001 and removes an antipattern I am trying to stop people copying in IIO. This particular case is more complex than most because it allowed probing via sysfs with out a fwnode but would presumably always have then failed. Now the code will assume that properties are the defaults if not specified or the firmware node is not present. This relaxation of the constraints should not break any existing cases and may enable some new ones. Signed-off-by: Jonathan Cameron Cc: Peter Meerwald --- drivers/iio/dac/mcp4725.c | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c index ee174d224110..beb9a15b7c74 100644 --- a/drivers/iio/dac/mcp4725.c +++ b/drivers/iio/dac/mcp4725.c @@ -16,8 +16,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -357,29 +357,16 @@ static const struct iio_info mcp4725_info = { .attrs = &mcp4725_attribute_group, }; -#ifdef CONFIG_OF static int mcp4725_probe_dt(struct device *dev, struct mcp4725_platform_data *pdata) { - struct device_node *np = dev->of_node; - - if (!np) - return -ENODEV; - /* check if is the vref-supply defined */ - pdata->use_vref = of_property_read_bool(np, "vref-supply"); + pdata->use_vref = device_property_read_bool(dev, "vref-supply"); pdata->vref_buffered = - of_property_read_bool(np, "microchip,vref-buffered"); + device_property_read_bool(dev, "microchip,vref-buffered"); return 0; } -#else -static int mcp4725_probe_dt(struct device *dev, - struct mcp4725_platform_data *platform_data) -{ - return -ENODEV; -} -#endif static int mcp4725_probe(struct i2c_client *client, const struct i2c_device_id *id) @@ -398,8 +385,8 @@ static int mcp4725_probe(struct i2c_client *client, data = iio_priv(indio_dev); i2c_set_clientdata(client, indio_dev); data->client = client; - if (client->dev.of_node) - data->id = (enum chip_id)of_device_get_match_data(&client->dev); + if (dev_fwnode(&client->dev)) + data->id = (enum chip_id)device_get_match_data(&client->dev); else data->id = id->driver_data; pdata = dev_get_platdata(&client->dev); @@ -519,7 +506,6 @@ static const struct i2c_device_id mcp4725_id[] = { }; MODULE_DEVICE_TABLE(i2c, mcp4725_id); -#ifdef CONFIG_OF static const struct of_device_id mcp4725_of_match[] = { { .compatible = "microchip,mcp4725", @@ -532,12 +518,11 @@ static const struct of_device_id mcp4725_of_match[] = { { } }; MODULE_DEVICE_TABLE(of, mcp4725_of_match); -#endif static struct i2c_driver mcp4725_driver = { .driver = { .name = MCP4725_DRV_NAME, - .of_match_table = of_match_ptr(mcp4725_of_match), + .of_match_table = mcp4725_of_match, .pm = &mcp4725_pm_ops, }, .probe = mcp4725_probe, From patchwork Thu Sep 10 17:32:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768327 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F22D139F for ; Thu, 10 Sep 2020 17:37:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 706E4221E5 for ; Thu, 10 Sep 2020 17:37:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759424; bh=lrmBXop/WLuC0YA7CBQo5Yntd7FPhktdQfv6mz5kJ78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Idl6/1DOfGJA+1uO+Dxpp5V8etcB4P1ssJRaDdibJx86iYVF+4klmCsQH+x1nlxuL eV1gcIN9C6gJesv9gsK2FR0QWiauPF7r9I8FyPcrvv1D+sgvHQYFqkP3YIV6Z8Edxh RA9dOv7ag4q2qiEhr+LZ1KMm8XupN1mofQAdljL4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726384AbgIJRhB (ORCPT ); Thu, 10 Sep 2020 13:37:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:47972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727775AbgIJRgA (ORCPT ); Thu, 10 Sep 2020 13:36:00 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EF2E920731; Thu, 10 Sep 2020 17:35:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759331; bh=lrmBXop/WLuC0YA7CBQo5Yntd7FPhktdQfv6mz5kJ78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bi9zuTQ3OzM4/a0ecxf0ftD8jQwcLpWMBtI29Nv5ZrF5SnsNU13AVrpmCTjbQJzoN THE3sjsw6JAk2sk/hwewkc8AU2RUUORNt7c8w0myLh5LZGZFV9Ks/s8kC6k55I1fZ+ b7Dc4uUZjoOZaWs/+KLc7v4csLu567v3wKXkG6So= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Lukas Wunner Subject: [PATCH 14/38] iio:dac:ti-dac082s085: Drop of_match_ptr and CONFIG_OF protections Date: Thu, 10 Sep 2020 18:32:18 +0100 Message-Id: <20200910173242.621168-15-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron These prevent the use of this driver with ACPI via PRP0001 and are an example of an anti pattern I'm trying to remove from IIO. Hence drop them from this driver. Signed-off-by: Jonathan Cameron Cc: Lukas Wunner --- drivers/iio/dac/ti-dac082s085.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/dac/ti-dac082s085.c b/drivers/iio/dac/ti-dac082s085.c index 86bfb1c3f9b9..de33c1fc6e0b 100644 --- a/drivers/iio/dac/ti-dac082s085.c +++ b/drivers/iio/dac/ti-dac082s085.c @@ -14,6 +14,7 @@ #include #include +#include #include #include @@ -324,7 +325,6 @@ static int ti_dac_remove(struct spi_device *spi) return 0; } -#ifdef CONFIG_OF static const struct of_device_id ti_dac_of_id[] = { { .compatible = "ti,dac082s085" }, { .compatible = "ti,dac102s085" }, @@ -335,7 +335,6 @@ static const struct of_device_id ti_dac_of_id[] = { { } }; MODULE_DEVICE_TABLE(of, ti_dac_of_id); -#endif static const struct spi_device_id ti_dac_spi_id[] = { { "dac082s085", dual_8bit }, @@ -351,7 +350,7 @@ MODULE_DEVICE_TABLE(spi, ti_dac_spi_id); static struct spi_driver ti_dac_driver = { .driver = { .name = "ti-dac082s085", - .of_match_table = of_match_ptr(ti_dac_of_id), + .of_match_table = ti_dac_of_id, }, .probe = ti_dac_probe, .remove = ti_dac_remove, From patchwork Thu Sep 10 17:32:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768391 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F104D17D4 for ; Thu, 10 Sep 2020 17:40:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D4237206A1 for ; Thu, 10 Sep 2020 17:40:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759610; bh=MGOhaJX7nCv7f7rWeUzTDUuEIm2qrKbUJkOWY6iJ97I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=FbJdLM65cRrTRwTF3bhHIncmsbcPDytSd3DkAbcvLdI18JwyYKU1zWgHrTQKbobbK P4O2+/0XWDrm00SUTIc1p7BHIThlhIX4Z+UEWqreJCKQwLrb0pkvUCuBP0n/F9oYhC sVLm/uUn/h20x+dPQATZob/Z7JHXGQKhkgAwbNiQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726991AbgIJRkI (ORCPT ); Thu, 10 Sep 2020 13:40:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:47974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727790AbgIJRgA (ORCPT ); Thu, 10 Sep 2020 13:36:00 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4AB3421582; Thu, 10 Sep 2020 17:35:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759333; bh=MGOhaJX7nCv7f7rWeUzTDUuEIm2qrKbUJkOWY6iJ97I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ocz2jleVGVJpvf3hk6TO/pXDyMG2swUlGhB6a6a5lUQdVc6lf0k00Gc2nqaN/SB7E kIySdFJF6S3dkmwgfG/T2wHymOLwdSq0/Rf7G/EsgKqrjK4X+9AaDpuyc79isvSNn8 F699ivosAW+XbN+JMpJaX1ZkOzhQxiUB8rAvxpIg= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Sean Nyekjaer Subject: [PATCH 15/38] iio:dac:ti-dac5571: Drop of_match_ptr and CONFIG_OF protections Date: Thu, 10 Sep 2020 18:32:19 +0100 Message-Id: <20200910173242.621168-16-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron These prevent the use of this driver with ACPI via PRP0001 and are an example of an anti pattern I'm trying to remove from IIO. Hence drop them from this driver. Signed-off-by: Jonathan Cameron Cc: Sean Nyekjaer --- drivers/iio/dac/ti-dac5571.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/iio/dac/ti-dac5571.c b/drivers/iio/dac/ti-dac5571.c index d303b19814e7..d3295767a079 100644 --- a/drivers/iio/dac/ti-dac5571.c +++ b/drivers/iio/dac/ti-dac5571.c @@ -18,8 +18,7 @@ #include #include #include -#include -#include +#include #include enum chip_id { @@ -384,7 +383,6 @@ static int dac5571_remove(struct i2c_client *i2c) return 0; } -#ifdef CONFIG_OF static const struct of_device_id dac5571_of_id[] = { {.compatible = "ti,dac5571"}, {.compatible = "ti,dac6571"}, @@ -398,7 +396,6 @@ static const struct of_device_id dac5571_of_id[] = { {} }; MODULE_DEVICE_TABLE(of, dac5571_of_id); -#endif static const struct i2c_device_id dac5571_id[] = { {"dac5571", single_8bit}, @@ -417,7 +414,7 @@ MODULE_DEVICE_TABLE(i2c, dac5571_id); static struct i2c_driver dac5571_driver = { .driver = { .name = "ti-dac5571", - .of_match_table = of_match_ptr(dac5571_of_id), + .of_match_table = dac5571_of_id, }, .probe = dac5571_probe, .remove = dac5571_remove, From patchwork Thu Sep 10 17:32:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768325 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC19C698 for ; Thu, 10 Sep 2020 17:36:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D0293221E3 for ; Thu, 10 Sep 2020 17:36:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759417; bh=xVW61def85Uv0/fHWE76hr7db86tAYKWR+K1Cfw3w6c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=t4XyCQiFdgHZCb8JildPowMYs1J8EFAbRcKDB3BS6FL6oXFjUyDnX+sqynvkkkl/Y 0Zyq5sOK4Kxr6hrllklvcSqYtIYUSeyAco/eWItVGnOJQVqLvpJgkDnJ5MhSfGRgEp tp6suCRhZhMNN/YTZuAHgQRNKh1RF2vIgh+dqk4w= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727025AbgIJRgw (ORCPT ); Thu, 10 Sep 2020 13:36:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:47976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727794AbgIJRgA (ORCPT ); Thu, 10 Sep 2020 13:36:00 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 99E70221EB; Thu, 10 Sep 2020 17:35:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759334; bh=xVW61def85Uv0/fHWE76hr7db86tAYKWR+K1Cfw3w6c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=00FBS4IWTiSEGd12SWPOextXxbgtfzNhh+8z64wnNC6Bgb/Gb3SQKzBdtlBjm9/7b sbzoc7nY0ReXXMwYOo3cph1zJRU9ciJ2z/F3KGcw7cF7cc/d55qkry2H5HvnIuhTsa vKjrVlUgGUw6SGRiupmh6ersw/a0WTQ4ngXiDp/U= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Matt Ranostay Subject: [PATCH 16/38] iio:potentiostat:lmp91000: Drop of_match_ptr and use generic fw accessors Date: Thu, 10 Sep 2020 18:32:20 +0100 Message-Id: <20200910173242.621168-17-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This change allows use of this driver with ACPI via PRP0001 and removes an example of an anti pattern I'm trying to remove from IIO. Signed-off-by: Jonathan Cameron Cc: Matt Ranostay Acked-by: Matt Ranostay --- drivers/iio/potentiostat/lmp91000.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/iio/potentiostat/lmp91000.c b/drivers/iio/potentiostat/lmp91000.c index 67ae635a05f3..f34ca769dc20 100644 --- a/drivers/iio/potentiostat/lmp91000.c +++ b/drivers/iio/potentiostat/lmp91000.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include @@ -205,13 +205,12 @@ static const struct iio_info lmp91000_info = { static int lmp91000_read_config(struct lmp91000_data *data) { struct device *dev = data->dev; - struct device_node *np = dev->of_node; unsigned int reg, val; int i, ret; - ret = of_property_read_u32(np, "ti,tia-gain-ohm", &val); + ret = device_property_read_u32(dev, "ti,tia-gain-ohm", &val); if (ret) { - if (!of_property_read_bool(np, "ti,external-tia-resistor")) { + if (!device_property_read_bool(dev, "ti,external-tia-resistor")) { dev_err(dev, "no ti,tia-gain-ohm defined and external resistor not specified\n"); return ret; } @@ -232,7 +231,7 @@ static int lmp91000_read_config(struct lmp91000_data *data) return ret; } - ret = of_property_read_u32(np, "ti,rload-ohm", &val); + ret = device_property_read_u32(dev, "ti,rload-ohm", &val); if (ret) { val = 100; dev_info(dev, "no ti,rload-ohm defined, default to %d\n", val); @@ -422,7 +421,7 @@ MODULE_DEVICE_TABLE(i2c, lmp91000_id); static struct i2c_driver lmp91000_driver = { .driver = { .name = LMP91000_DRV_NAME, - .of_match_table = of_match_ptr(lmp91000_of_match), + .of_match_table = lmp91000_of_match, }, .probe = lmp91000_probe, .remove = lmp91000_remove, From patchwork Thu Sep 10 17:32:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768389 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C24E0698 for ; Thu, 10 Sep 2020 17:40:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9CFCF206A1 for ; Thu, 10 Sep 2020 17:40:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759610; bh=3ZzsgVXWiUsw2MOOAw6VdAfqjtG1nFMCujkrjuTF6ac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=P45amDd1NF9yFLzY0cKnEtY/wURstcBNgoC1xV2HgZZNG2nHkpRQ1GRiv8QYVYlk+ gfK+sfIo+bwOLUSCwEfEnBp0mjSzbDVlBhViiFGSUpkPDA01GKzgF6Ka1Q7EEFFO7v SODPdgMS3UGPLailB75rhXvyQ5E6e+e4e/YqCvtc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727027AbgIJRkI (ORCPT ); Thu, 10 Sep 2020 13:40:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:47978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727801AbgIJRgA (ORCPT ); Thu, 10 Sep 2020 13:36:00 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EB9ED221F1; Thu, 10 Sep 2020 17:35:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759335; bh=3ZzsgVXWiUsw2MOOAw6VdAfqjtG1nFMCujkrjuTF6ac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DKbCq4ckt9feyCL3VZXgWXZIxxUaw68ncz2MQwnxl1C0dm0Hry5uPzF9N4Sv7qYj5 cRKiKBCcRUrF5bFR9Uzq9sVAFQ6+umpGmBQKJtuLoWtQUgG0DtzBljybXOQj7YMMBT 14jo8sIeEIHrAehfn2WxF9iwoRSDKkQzhKodGvbc= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Jean-Baptiste Maneyrol Subject: [PATCH 17/38] iio:pressure:icp10100: Drop of_match_ptr and CONFIG_OF protections Date: Thu, 10 Sep 2020 18:32:21 +0100 Message-Id: <20200910173242.621168-18-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron These prevents use of this driver with ACPI via PRP0001 and are an example of an anti pattern I'm trying to remove from IIO. Hence drop them from this driver. Signed-off-by: Jonathan Cameron Cc: Jean-Baptiste Maneyrol --- drivers/iio/pressure/icp10100.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/pressure/icp10100.c b/drivers/iio/pressure/icp10100.c index 90c0df068bbb..48759fc4bf18 100644 --- a/drivers/iio/pressure/icp10100.c +++ b/drivers/iio/pressure/icp10100.c @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -645,7 +646,7 @@ static struct i2c_driver icp10100_driver = { .driver = { .name = "icp10100", .pm = &icp10100_pm, - .of_match_table = of_match_ptr(icp10100_of_match), + .of_match_table = icp10100_of_match, }, .probe = icp10100_probe, .id_table = icp10100_id, From patchwork Thu Sep 10 17:32:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768339 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B67C3698 for ; Thu, 10 Sep 2020 17:37:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 97586206A1 for ; Thu, 10 Sep 2020 17:37:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759478; bh=cXootZKrgeLDcJ9SEVrRtl/e4xuUl1nD7EO4bR3RNTs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=bNleJyIiEdZinw4KZ98SM30IU3lGuZ7eMhC8J0WKmSyqcxCmHyz5iI2zIphgQbU5x PPAyFAj8kOHAED5dL3FVHwKGR/0HY0j102P04hU/+wZUEBNuj/35V0hoCQlgj76oHg 3snex8hrQuSPyJhn2YIM/kTThfqf3839Wi9tjTUo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726973AbgIJRhu (ORCPT ); Thu, 10 Sep 2020 13:37:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:48084 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727808AbgIJRgI (ORCPT ); Thu, 10 Sep 2020 13:36:08 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 51E4022204; Thu, 10 Sep 2020 17:35:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759337; bh=cXootZKrgeLDcJ9SEVrRtl/e4xuUl1nD7EO4bR3RNTs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P4njzWQC1ICSW6RvZnUF79cBi+46jv5nulsUgovNaYnM571W0tXu4Ok2MTQtUDJiX mqlpf53yMFseq7L9I0fDyCIcCzf6z6JW5z2t8sgJJSMzJpBym+b/oRGUpJW2CqY/N3 crvAvW85uicDRAfMLv8SLDMWSfvwHFO5X3rNDqRs= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Tomasz Duszynski Subject: [PATCH 18/38] iio:pressure:ms5611: Drop of_match_ptr and CONFIG_OF protections Date: Thu, 10 Sep 2020 18:32:22 +0100 Message-Id: <20200910173242.621168-19-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron These prevents use of this driver with ACPI via PRP0001 and are an example of an anti pattern I'm trying to remove from IIO. Hence drop them from this driver. Signed-off-by: Jonathan Cameron Cc: Tomasz Duszynski --- drivers/iio/pressure/ms5611_i2c.c | 6 ++---- drivers/iio/pressure/ms5611_spi.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/iio/pressure/ms5611_i2c.c b/drivers/iio/pressure/ms5611_i2c.c index 072c106dd66d..7c04f730430c 100644 --- a/drivers/iio/pressure/ms5611_i2c.c +++ b/drivers/iio/pressure/ms5611_i2c.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include @@ -113,14 +113,12 @@ static int ms5611_i2c_remove(struct i2c_client *client) return ms5611_remove(i2c_get_clientdata(client)); } -#if defined(CONFIG_OF) static const struct of_device_id ms5611_i2c_matches[] = { { .compatible = "meas,ms5611" }, { .compatible = "meas,ms5607" }, { } }; MODULE_DEVICE_TABLE(of, ms5611_i2c_matches); -#endif static const struct i2c_device_id ms5611_id[] = { { "ms5611", MS5611 }, @@ -132,7 +130,7 @@ MODULE_DEVICE_TABLE(i2c, ms5611_id); static struct i2c_driver ms5611_driver = { .driver = { .name = "ms5611", - .of_match_table = of_match_ptr(ms5611_i2c_matches) + .of_match_table = ms5611_i2c_matches, }, .id_table = ms5611_id, .probe = ms5611_i2c_probe, diff --git a/drivers/iio/pressure/ms5611_spi.c b/drivers/iio/pressure/ms5611_spi.c index 4799aa57135e..45d3a7d5be8e 100644 --- a/drivers/iio/pressure/ms5611_spi.c +++ b/drivers/iio/pressure/ms5611_spi.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include @@ -115,14 +115,12 @@ static int ms5611_spi_remove(struct spi_device *spi) return ms5611_remove(spi_get_drvdata(spi)); } -#if defined(CONFIG_OF) static const struct of_device_id ms5611_spi_matches[] = { { .compatible = "meas,ms5611" }, { .compatible = "meas,ms5607" }, { } }; MODULE_DEVICE_TABLE(of, ms5611_spi_matches); -#endif static const struct spi_device_id ms5611_id[] = { { "ms5611", MS5611 }, @@ -134,7 +132,7 @@ MODULE_DEVICE_TABLE(spi, ms5611_id); static struct spi_driver ms5611_driver = { .driver = { .name = "ms5611", - .of_match_table = of_match_ptr(ms5611_spi_matches) + .of_match_table = ms5611_spi_matches }, .id_table = ms5611_id, .probe = ms5611_spi_probe, From patchwork Thu Sep 10 17:32:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768387 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7ADF214F6 for ; Thu, 10 Sep 2020 17:40:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5F00E21D40 for ; Thu, 10 Sep 2020 17:40:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759610; bh=jX7d/q07bb0yUNhq92Q8mLQoAcpDdgi9QFVlVXqSryM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=aONsLnOPclseIg+UPDjnLAwQJFK5jFkuNW93skVvyouKIjgnXptVnJeChpa2Vn+7E XVczxXytanMZ3IQ7a9hU+eSvEiqJ782yLfxoETWdIvFDJ+RgUUGvUXRcqUxaKsOBXU jV35v3wCkG6pl/ASWlhB2OPE4yR8bIB6jdj7Ei1g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726780AbgIJRkH (ORCPT ); Thu, 10 Sep 2020 13:40:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:47868 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727122AbgIJRgH (ORCPT ); Thu, 10 Sep 2020 13:36:07 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A872422205; Thu, 10 Sep 2020 17:35:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759338; bh=jX7d/q07bb0yUNhq92Q8mLQoAcpDdgi9QFVlVXqSryM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fa57UGphh1njDenxiQ9i8OLr8Te/qnSIH+p8ODry6//rfkuxJXXmxI4uPcfBXTZUl n9F123D3da273cjGE4UHj25iaIHA1gtqhgcHvb/gG0rFkC5wZboMi5msd3brKr9+ym 88wXRCf7c0KMJFn30ES7o6HkXDA6gNE6GfAGpZvY= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Ludovic Tancerel Subject: [PATCH 19/38] iio:pressure:ms5637: Drop of_match_ptr protection Date: Thu, 10 Sep 2020 18:32:23 +0100 Message-Id: <20200910173242.621168-20-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This prevents use of this driver with ACPI via PRP0001 and is an example of an anti pattern I'm trying to remove from IIO. Hence drop from this driver. Signed-off-by: Jonathan Cameron Cc: Ludovic Tancerel --- drivers/iio/pressure/ms5637.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/pressure/ms5637.c b/drivers/iio/pressure/ms5637.c index 05e0ef7260d5..5b59a4137d32 100644 --- a/drivers/iio/pressure/ms5637.c +++ b/drivers/iio/pressure/ms5637.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -192,7 +193,7 @@ static struct i2c_driver ms5637_driver = { .id_table = ms5637_id, .driver = { .name = "ms5637", - .of_match_table = of_match_ptr(ms5637_of_match), + .of_match_table = ms5637_of_match, }, }; From patchwork Thu Sep 10 17:32:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768383 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B5FE914F6 for ; Thu, 10 Sep 2020 17:40:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 94FE421D40 for ; Thu, 10 Sep 2020 17:40:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759608; bh=EfAWBIN9frRch8G2sNi2HkkIqXjbdjByclva8hteT/s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=OjOublRQevNbzUaDiQNmBx+QrTDQQKyrfkn8oKum+WQxlczFiG1nwddCX5L5qP5iu /29sLw/AI2O3u2BS5L66i17lSNY8iaYOMe50T9UTfLt7IXSW4wgaIXfMB6e0LDYPzO ptiGYr5IjlQm3RfmMfbgV28UpCbxDDVl/Nru1VMs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726994AbgIJRkH (ORCPT ); Thu, 10 Sep 2020 13:40:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:47866 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727807AbgIJRgH (ORCPT ); Thu, 10 Sep 2020 13:36:07 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1101C206A1; Thu, 10 Sep 2020 17:35:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759340; bh=EfAWBIN9frRch8G2sNi2HkkIqXjbdjByclva8hteT/s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MGzSV+img0h5e08FE/Xdv6trNbfJY5VJuxRSJ+3Xa/Jer+IbULtZGvQP4Y1FRP/3c YQbksUnniAspImbFI9iLma1eWTTVURAwWm8n7GiZAz95eKPmfvRlXd9bd680WVnGzg ZSthg9MneDD4ViuWsHzcuhrs31ftG/nob27hya9A= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Gregor Boirie Subject: [PATCH 20/38] iio:pressure:zpa2326: Drop of_match_ptr protection Date: Thu, 10 Sep 2020 18:32:24 +0100 Message-Id: <20200910173242.621168-21-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This prevents use of this driver with ACPI via PRP0001 and is an example of an anti pattern I'm trying to remove from IIO. Hence drop from this driver. Signed-off-by: Jonathan Cameron Cc: Gregor Boirie --- drivers/iio/pressure/zpa2326_i2c.c | 6 ++---- drivers/iio/pressure/zpa2326_spi.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/iio/pressure/zpa2326_i2c.c b/drivers/iio/pressure/zpa2326_i2c.c index 1a65791ba279..95d9739444c4 100644 --- a/drivers/iio/pressure/zpa2326_i2c.c +++ b/drivers/iio/pressure/zpa2326_i2c.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include "zpa2326.h" /* @@ -66,18 +66,16 @@ static const struct i2c_device_id zpa2326_i2c_ids[] = { }; MODULE_DEVICE_TABLE(i2c, zpa2326_i2c_ids); -#if defined(CONFIG_OF) static const struct of_device_id zpa2326_i2c_matches[] = { { .compatible = "murata,zpa2326" }, { } }; MODULE_DEVICE_TABLE(of, zpa2326_i2c_matches); -#endif static struct i2c_driver zpa2326_i2c_driver = { .driver = { .name = "zpa2326-i2c", - .of_match_table = of_match_ptr(zpa2326_i2c_matches), + .of_match_table = zpa2326_i2c_matches, .pm = ZPA2326_PM_OPS, }, .probe = zpa2326_probe_i2c, diff --git a/drivers/iio/pressure/zpa2326_spi.c b/drivers/iio/pressure/zpa2326_spi.c index f37a4c738c75..85201a4bae44 100644 --- a/drivers/iio/pressure/zpa2326_spi.c +++ b/drivers/iio/pressure/zpa2326_spi.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include "zpa2326.h" /* @@ -70,18 +70,16 @@ static const struct spi_device_id zpa2326_spi_ids[] = { }; MODULE_DEVICE_TABLE(spi, zpa2326_spi_ids); -#if defined(CONFIG_OF) static const struct of_device_id zpa2326_spi_matches[] = { { .compatible = "murata,zpa2326" }, { } }; MODULE_DEVICE_TABLE(of, zpa2326_spi_matches); -#endif static struct spi_driver zpa2326_spi_driver = { .driver = { .name = "zpa2326-spi", - .of_match_table = of_match_ptr(zpa2326_spi_matches), + .of_match_table = zpa2326_spi_matches, .pm = ZPA2326_PM_OPS, }, .probe = zpa2326_probe_spi, From patchwork Thu Sep 10 17:32:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768341 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4875814F6 for ; Thu, 10 Sep 2020 17:37:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2659821582 for ; Thu, 10 Sep 2020 17:37:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759479; bh=UiiKQ6C10JhV4gEG1WsDhxmh2o901QY7gomr0MUp1DU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Sr3yDAfxugqoIvSDnUINCgDNx7XtXQkYeFv7Akn0OtgYXHZAsUu1SEzhvOz8OYqu4 xLBZ1Ss87LJ1fVLIHq6/N5saQ3p2oMoWr+rzmtx4zMdP1FD8EyZJ4wuGyLuUkQCro+ vWWyStIWPOQ30tfXbKPevtoZoSy1ny1Yuo4yQP+k= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727808AbgIJRhx (ORCPT ); Thu, 10 Sep 2020 13:37:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:48086 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727812AbgIJRgH (ORCPT ); Thu, 10 Sep 2020 13:36:07 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6BD9B22206; Thu, 10 Sep 2020 17:35:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759341; bh=UiiKQ6C10JhV4gEG1WsDhxmh2o901QY7gomr0MUp1DU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UjgKtfN/nJrjyDjnNoC5KIEclDtcDu9Z+AgvqqxHqqv4nFqpxgKxR79LPPjRR4Qt2 kNEXF6jEKas6MiaQE4np7+5PFbaEey0JFEnG606eKunl/0Qim+TjROh9q8ZDwW7bmO jjc49YkEKEYLMCnNiur+81MiTjOj1CTfJlfcVzuk= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Ludovic Tancerel Subject: [PATCH 21/38] iio:temperature:tsys01: Drop of_match_ptr protection Date: Thu, 10 Sep 2020 18:32:25 +0100 Message-Id: <20200910173242.621168-22-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This prevents use of this driver with ACPI via PRP0001 and is an example of an anti pattern I'm trying to remove from IIO. Hence drop from this driver. Signed-off-by: Jonathan Cameron Cc: Ludovic Tancerel --- drivers/iio/temperature/tsys01.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/temperature/tsys01.c b/drivers/iio/temperature/tsys01.c index 2c631a1ca33b..bbfbad9a8767 100644 --- a/drivers/iio/temperature/tsys01.c +++ b/drivers/iio/temperature/tsys01.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -222,7 +223,7 @@ static struct i2c_driver tsys01_driver = { .id_table = tsys01_id, .driver = { .name = "tsys01", - .of_match_table = of_match_ptr(tsys01_of_match), + .of_match_table = tsys01_of_match, }, }; From patchwork Thu Sep 10 17:32:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768381 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 81578698 for ; Thu, 10 Sep 2020 17:40:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 61E9C21582 for ; Thu, 10 Sep 2020 17:40:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759608; bh=OSqA9MJUD+SMez8Uad9aTYpl2IE6ypJvSF7gtwYvU9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ZSDSB5MO19eWhHINkZVnXPZuF2grplmKFNy96fix+zYYVIvNplzQqkpIPMyIa0khr Kz6ILhkZbluHi8hzBTddT2i8U5YqNtifoDq0OkMvD1bhOzkqzlOYCMjm5EcuV03TSb UtzmcRbsTZ1yI30SltBhVHsjV1LI5FPeoenYhric= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726287AbgIJRkG (ORCPT ); Thu, 10 Sep 2020 13:40:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:47894 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726942AbgIJRgk (ORCPT ); Thu, 10 Sep 2020 13:36:40 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CED6022209; Thu, 10 Sep 2020 17:35:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759342; bh=OSqA9MJUD+SMez8Uad9aTYpl2IE6ypJvSF7gtwYvU9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0poER1Wg6fTRRaYO2hcjauB1oYcgLlxmwYi9r2VEDHqda3CG9yqeiJPynF0RVFG9y NYjkpzXoBpqggKutkRAtpUGmx+cwUBsMqhx10BiSh8jwxIOu6gGgydT5u+3JDek8ba R+rhZOXFL8jlYT3zb4Fag0UsJRpli5FhEmliAW6E= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Manivannan Sadhasivam Subject: [PATCH 22/38] iio:temperature:tmp007: Drop of_match_ptr protection Date: Thu, 10 Sep 2020 18:32:26 +0100 Message-Id: <20200910173242.621168-23-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This prevents use of this driver with ACPI via PRP0001 and is an example of an anti pattern I'm trying to remove from IIO. Hence drop from this driver. Signed-off-by: Jonathan Cameron Cc: Manivannan Sadhasivam --- drivers/iio/temperature/tmp007.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/temperature/tmp007.c b/drivers/iio/temperature/tmp007.c index f90fe9e5617b..ad2b35c65548 100644 --- a/drivers/iio/temperature/tmp007.c +++ b/drivers/iio/temperature/tmp007.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include @@ -578,7 +578,7 @@ MODULE_DEVICE_TABLE(i2c, tmp007_id); static struct i2c_driver tmp007_driver = { .driver = { .name = "tmp007", - .of_match_table = of_match_ptr(tmp007_of_match), + .of_match_table = tmp007_of_match, .pm = &tmp007_pm_ops, }, .probe = tmp007_probe, From patchwork Thu Sep 10 17:32:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768379 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 31B76698 for ; Thu, 10 Sep 2020 17:40:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0BEDF21582 for ; Thu, 10 Sep 2020 17:40:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759607; bh=/0uhkTEyCAIImJU4E4tLF5MTr4G21ANWyYheb9Ik3qg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=iGRzbScrQG6OW67aAFFyidvpW6AtfUnmXqIMkaEZY+yj7yC1PmP/8dURo9dAMqqhv G+hUmqDNhkiEv1lrfwSM0uYl8xw8J18Ox94FYkJBn8icGgsFxpI+ER/Znfuwa2/woJ 7yGrjuQTnA5UwQtJE4GT+ti4OoUSxX8Sr+bf7Wts= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725864AbgIJRkF (ORCPT ); Thu, 10 Sep 2020 13:40:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:47774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726287AbgIJRgk (ORCPT ); Thu, 10 Sep 2020 13:36:40 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2DCEE2220E; Thu, 10 Sep 2020 17:35:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759343; bh=/0uhkTEyCAIImJU4E4tLF5MTr4G21ANWyYheb9Ik3qg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fP+3iO0Oii4tcHEL5fUgMNaaj5KfpkqSHYv4mfhxMbeAwDj+OAS6sg9c6FWwqMf+F pl9cEMgDsNsNO3k/UVVSUTQI7tD7vve30qlmWlGp4RlTGkbNW6FltU2+TJ3UnR1lZZ thIBhDstwHHVtzr74bknYrvvtc/c2LsSBTLUTUVQ= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron Subject: [PATCH 23/38] iio:resolver:ad2s1200: Drop of_match_ptr protection Date: Thu, 10 Sep 2020 18:32:27 +0100 Message-Id: <20200910173242.621168-24-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This prevents use of this driver with ACPI via PRP0001 and is an example of an anti pattern I'm trying to remove from IIO. Hence drop from this driver. Signed-off-by: Jonathan Cameron --- drivers/iio/resolver/ad2s1200.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/resolver/ad2s1200.c b/drivers/iio/resolver/ad2s1200.c index 6007abad116b..9746bd935628 100644 --- a/drivers/iio/resolver/ad2s1200.c +++ b/drivers/iio/resolver/ad2s1200.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -192,7 +193,7 @@ MODULE_DEVICE_TABLE(spi, ad2s1200_id); static struct spi_driver ad2s1200_driver = { .driver = { .name = DRV_NAME, - .of_match_table = of_match_ptr(ad2s1200_of_match), + .of_match_table = ad2s1200_of_match, }, .probe = ad2s1200_probe, .id_table = ad2s1200_id, From patchwork Thu Sep 10 17:32:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768385 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4CD03139F for ; Thu, 10 Sep 2020 17:40:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2D50721582 for ; Thu, 10 Sep 2020 17:40:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759610; bh=CBO7LMghT6TP9wjynIdEjpe6+/KEIi18ws0ztpOb5xs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=fmv48npZoDmRi5I2EcQTzK1IYlQHo5m3DkDB9aAugf9s+Vlai9A25kSFyUSv/Dxoy uib3KzEicTLHDSxrTcJcdzljj7NJxAM4K8pprqXS/ej5z2IveL0CJ0YMf1+EoZJoc/ PNADN6tOzzprn/nGVkkwIdtXP7TR2EGO8aVln5kU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726942AbgIJRkG (ORCPT ); Thu, 10 Sep 2020 13:40:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:48176 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727067AbgIJRgk (ORCPT ); Thu, 10 Sep 2020 13:36:40 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5A0C322208; Thu, 10 Sep 2020 17:35:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759345; bh=CBO7LMghT6TP9wjynIdEjpe6+/KEIi18ws0ztpOb5xs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WWDEC8IjU6QkUdWg6sVQpCXCcZisYUsPwnlcoX5Q2l+rAr04zHn77naek5gPFMy7g /6Og7IoOKisyVxNynsX/3Qh4OcKIKVZbllShockVHVvUOA6Xe80RF9UNEPI4brP6qt v4NSHR5tUs03b1gHgGeDC1OeGfFmbu/h1JgKs/Rk= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Matt Ranostay Subject: [PATCH 24/38] iio:chemical:ams-iaq-core: Drop of_match_ptr protection Date: Thu, 10 Sep 2020 18:32:28 +0100 Message-Id: <20200910173242.621168-25-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This prevents use of this driver with ACPI via PRP0001 and is an example of an anti pattern I'm trying to remove from IIO. Hence drop from this driver. Signed-off-by: Jonathan Cameron Cc: Matt Ranostay Acked-by: Matt Ranostay --- drivers/iio/chemical/ams-iaq-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/chemical/ams-iaq-core.c b/drivers/iio/chemical/ams-iaq-core.c index 8c1b64fd424a..97be3669c554 100644 --- a/drivers/iio/chemical/ams-iaq-core.c +++ b/drivers/iio/chemical/ams-iaq-core.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -177,7 +178,7 @@ MODULE_DEVICE_TABLE(of, ams_iaqcore_dt_ids); static struct i2c_driver ams_iaqcore_driver = { .driver = { .name = "ams-iaq-core", - .of_match_table = of_match_ptr(ams_iaqcore_dt_ids), + .of_match_table = ams_iaqcore_dt_ids, }, .probe = ams_iaqcore_probe, .id_table = ams_iaqcore_id, From patchwork Thu Sep 10 17:32:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768377 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A690F14F6 for ; Thu, 10 Sep 2020 17:40:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8152C21582 for ; Thu, 10 Sep 2020 17:40:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759606; bh=NLISiQ3mz76FOuNlkNOVftUmh3IA1PiRrRW2tBzQnLE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=E8QyronNrk3D4Cx/wNzYM1MnvTtaWaZ68cTqJ95FHjFNDya855imMP2/eEARYIPfK 4a1N6cP8u4XXj6jjX9d+5nUXYOTPf1weLrHuBPpIVUVHzleBmpsm+bPbP8WZBM5Hsa dl2HQnXC5KduDshExx6qli3Ee9xSENTZdTtflDl8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725965AbgIJRkC (ORCPT ); Thu, 10 Sep 2020 13:40:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:48178 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727823AbgIJRgk (ORCPT ); Thu, 10 Sep 2020 13:36:40 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AF06922210; Thu, 10 Sep 2020 17:35:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759346; bh=NLISiQ3mz76FOuNlkNOVftUmh3IA1PiRrRW2tBzQnLE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yiutdbcPNkBpdYcZWgxEeWAP826fk669v3YNd3/Uj9YOg0/KrE6I2Qvz4SLVycMLC US45wiVkTIH6GOoc/trkGUYLMMDoUkatAYFjaWncqFPwKERshbshfRxy11IFHGHpZm IPa6AIHpOGXEqTTUrDrzlV63TYivALsbd1W89b1s= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Matt Ranostay Subject: [PATCH 25/38] iio:chemical:atlas-sensor: Drop of_match_ptr and use generic fw accessors Date: Thu, 10 Sep 2020 18:32:29 +0100 Message-Id: <20200910173242.621168-26-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron of_match_ptr() prevents use of this driver with ACPI via PRP0001 and is an example of an anti pattern I'm trying to remove from IIO. Hence drop from this driver and use generic fw accessors to check if there is a fw_node and get the id. It might be neater to use pointers rather than indexes for the device_data but that is another issue and should be handled separately. Signed-off-by: Jonathan Cameron Cc: Matt Ranostay Acked-by: Matt Ranostay --- drivers/iio/chemical/atlas-sensor.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/iio/chemical/atlas-sensor.c b/drivers/iio/chemical/atlas-sensor.c index 43069636fcd5..cdab9d04dedd 100644 --- a/drivers/iio/chemical/atlas-sensor.c +++ b/drivers/iio/chemical/atlas-sensor.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include @@ -620,7 +620,6 @@ static int atlas_probe(struct i2c_client *client, { struct atlas_data *data; struct atlas_device *chip; - const struct of_device_id *of_id; struct iio_trigger *trig; struct iio_dev *indio_dev; int ret; @@ -629,11 +628,10 @@ static int atlas_probe(struct i2c_client *client, if (!indio_dev) return -ENOMEM; - of_id = of_match_device(atlas_dt_ids, &client->dev); - if (!of_id) + if (!dev_fwnode(&client->dev)) chip = &atlas_devices[id->driver_data]; else - chip = &atlas_devices[(unsigned long)of_id->data]; + chip = &atlas_devices[(unsigned long)device_get_match_data(&client->dev)]; indio_dev->info = &atlas_info; indio_dev->name = ATLAS_DRV_NAME; @@ -775,7 +773,7 @@ static const struct dev_pm_ops atlas_pm_ops = { static struct i2c_driver atlas_driver = { .driver = { .name = ATLAS_DRV_NAME, - .of_match_table = of_match_ptr(atlas_dt_ids), + .of_match_table = atlas_dt_ids, .pm = &atlas_pm_ops, }, .probe = atlas_probe, From patchwork Thu Sep 10 17:32:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768373 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1F50114F6 for ; Thu, 10 Sep 2020 17:40:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04F61206A1 for ; Thu, 10 Sep 2020 17:40:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759602; bh=ANDr36kbhRkXPrMr7XRTbOM5qPlEbp4wf/K4dJHBd9U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=BHkNl75j8cZw/BvcAA9Vlk0nyuOTeFGrkPpPd5Jji+uZW9OtpyV/Ll5uroFEcrJcz nKpESSHQaXf+KZzecnNYmuNoHOUKRBgnnfSCX14bD4vqmmJeNl/q8TkojDrUBE6Q8k tj0xObMb8GUIaeZw5q9J3Qor615QqiR1VyAujAFA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726663AbgIJRjz (ORCPT ); Thu, 10 Sep 2020 13:39:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:47972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727835AbgIJRgu (ORCPT ); Thu, 10 Sep 2020 13:36:50 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 128182220F; Thu, 10 Sep 2020 17:35:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759348; bh=ANDr36kbhRkXPrMr7XRTbOM5qPlEbp4wf/K4dJHBd9U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rD0pwttYjRHgL/DdaNWVUHNpPkjRuN0OiE6Eto6kiCVVw9VQkUF+uM+PrfWU388II P/HFNR4gDQkdv0bmq3XG7WS92m6eCOLAWwUb66p4jn7uwyhL+qkY4xF9GGsOIF/dbH kZsr4y3Xvw44BImSPheGm2TFBwKFzWXuJbyESRNw= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Andreas Brauchli Subject: [PATCH 26/38] iio:chemical:sgp30: Use local variable dev to simplify code Date: Thu, 10 Sep 2020 18:32:30 +0100 Message-Id: <20200910173242.621168-27-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This cleans up the code at bit, but is primarily here as a precusor to the next patch. I've only done this for the two functions which use the dev pointer repeatedly. Signed-off-by: Jonathan Cameron Cc: Andreas Brauchli --- drivers/iio/chemical/sgp30.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/iio/chemical/sgp30.c b/drivers/iio/chemical/sgp30.c index 2c4086c48136..410565aa20b6 100644 --- a/drivers/iio/chemical/sgp30.c +++ b/drivers/iio/chemical/sgp30.c @@ -409,6 +409,7 @@ static int sgp_read_raw(struct iio_dev *indio_dev, static int sgp_check_compat(struct sgp_data *data, unsigned int product_id) { + struct device *dev = &data->client->dev; const struct sgp_version *supported_versions; u16 ix, num_fs; u16 product, generation, major, minor; @@ -416,21 +417,20 @@ static int sgp_check_compat(struct sgp_data *data, /* driver does not match product */ generation = SGP_VERS_GEN(data); if (generation != 0) { - dev_err(&data->client->dev, + dev_err(dev, "incompatible product generation %d != 0", generation); return -ENODEV; } product = SGP_VERS_PRODUCT(data); if (product != product_id) { - dev_err(&data->client->dev, - "sensor reports a different product: 0x%04hx\n", + dev_err(dev, "sensor reports a different product: 0x%04hx\n", product); return -ENODEV; } if (SGP_VERS_RESERVED(data)) - dev_warn(&data->client->dev, "reserved bit is set\n"); + dev_warn(dev, "reserved bit is set\n"); /* engineering samples are not supported: no interface guarantees */ if (SGP_VERS_ENG_BIT(data)) @@ -456,8 +456,7 @@ static int sgp_check_compat(struct sgp_data *data, minor >= supported_versions[ix].minor) return 0; } - dev_err(&data->client->dev, "unsupported sgp version: %d.%d\n", - major, minor); + dev_err(dev, "unsupported sgp version: %d.%d\n", major, minor); return -ENODEV; } @@ -499,17 +498,18 @@ static const struct of_device_id sgp_dt_ids[] = { static int sgp_probe(struct i2c_client *client, const struct i2c_device_id *id) { + struct device *dev = &client->dev; struct iio_dev *indio_dev; struct sgp_data *data; const struct of_device_id *of_id; unsigned long product_id; int ret; - indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data)); + indio_dev = devm_iio_device_alloc(dev, sizeof(*data)); if (!indio_dev) return -ENOMEM; - of_id = of_match_device(sgp_dt_ids, &client->dev); + of_id = of_match_device(sgp_dt_ids, dev); if (of_id) product_id = (unsigned long)of_id->data; else @@ -541,9 +541,9 @@ static int sgp_probe(struct i2c_client *client, sgp_init(data); - ret = devm_iio_device_register(&client->dev, indio_dev); + ret = devm_iio_device_register(dev, indio_dev); if (ret) { - dev_err(&client->dev, "failed to register iio device\n"); + dev_err(dev, "failed to register iio device\n"); return ret; } From patchwork Thu Sep 10 17:32:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768375 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 05C64698 for ; Thu, 10 Sep 2020 17:40:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D693F21582 for ; Thu, 10 Sep 2020 17:40:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759605; bh=lacLNbGl4/2YzTZ+mj4TMgbfYzm7gBmGfKlrbUCBWks=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=WPP32rIS5wI3NWCSdXkTzZuKlCVZLDk7Fev5WMti7PZPqbnzescuzeYyYdjmYhwuS 1lRIUK808VY0a3mk2fRrkxPof+SuhiQyKuaxUjpZ/anbGzjXsj+sVAbDS3dO2WZhhy pGJBR2c5Ic+AeehybXzTAj61ZwCvq4mgNt1v2Kuo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726926AbgIJRj6 (ORCPT ); Thu, 10 Sep 2020 13:39:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:48282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727837AbgIJRgu (ORCPT ); Thu, 10 Sep 2020 13:36:50 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6D95520C09; Thu, 10 Sep 2020 17:35:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759349; bh=lacLNbGl4/2YzTZ+mj4TMgbfYzm7gBmGfKlrbUCBWks=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e8RLYS0KWwhXnv3Qb8S9SDMqMJMsNTvOXbi1vFlt96g3FWPzoJGU07lb8NvgvJLGG u+Qutk3UMGffofZ5BiR0OeeWpZPa+8zNlfby0mq31HshKUrfzQ9Kr+SPN3TdGS/VUZ D+QrnsoCQT8Z8PVJOA5WJzVxAe0z1R16mWkXma+s= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Andreas Brauchli Subject: [PATCH 27/38] iio:chemical:sgp30: Drop of_match_ptr and use generic fw accessors Date: Thu, 10 Sep 2020 18:32:31 +0100 Message-Id: <20200910173242.621168-28-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This change allow the driver to be used with ACPI PRP0001 and removes an antipattern that I want to avoid being copied into new IIO drivers. The handling of match_data uses a different approach as device_get_match_data doesn't distinguish between no match, and a match but with NULL data. Signed-off-by: Jonathan Cameron Cc: Andreas Brauchli --- drivers/iio/chemical/sgp30.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/iio/chemical/sgp30.c b/drivers/iio/chemical/sgp30.c index 410565aa20b6..c2d93b9796ce 100644 --- a/drivers/iio/chemical/sgp30.c +++ b/drivers/iio/chemical/sgp30.c @@ -20,9 +20,9 @@ #include #include #include +#include #include #include -#include #include #include @@ -501,7 +501,6 @@ static int sgp_probe(struct i2c_client *client, struct device *dev = &client->dev; struct iio_dev *indio_dev; struct sgp_data *data; - const struct of_device_id *of_id; unsigned long product_id; int ret; @@ -509,9 +508,8 @@ static int sgp_probe(struct i2c_client *client, if (!indio_dev) return -ENOMEM; - of_id = of_match_device(sgp_dt_ids, dev); - if (of_id) - product_id = (unsigned long)of_id->data; + if (dev_fwnode(dev)) + product_id = (unsigned long)device_get_match_data(dev); else product_id = id->driver_data; @@ -576,7 +574,7 @@ MODULE_DEVICE_TABLE(of, sgp_dt_ids); static struct i2c_driver sgp_driver = { .driver = { .name = "sgp30", - .of_match_table = of_match_ptr(sgp_dt_ids), + .of_match_table = sgp_dt_ids, }, .probe = sgp_probe, .remove = sgp_remove, From patchwork Thu Sep 10 17:32:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768343 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 417F1698 for ; Thu, 10 Sep 2020 17:38:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 173D821582 for ; Thu, 10 Sep 2020 17:38:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759501; bh=A+rbBZcSwA1vVV+gXrbuzEKrGKprbEimgMWYsizCN5Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KCohrL5+P2/PXRSLPLUpns7Ef//UgVhDC/GqHHEyN5RBIFMUjUwNuCehLcmsrSGD5 IeYb/vFffpYBdWan9GMVMNvJrxmKy6RF+APtttXAqTglTl8/6cxCF6aJidOvPU3vhK zNzv5PP6XFANHFqp/gNuFkeKLFTi2O18cONSGpl0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727876AbgIJRiL (ORCPT ); Thu, 10 Sep 2020 13:38:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:47976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726657AbgIJRgw (ORCPT ); Thu, 10 Sep 2020 13:36:52 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C012822211; Thu, 10 Sep 2020 17:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759350; bh=A+rbBZcSwA1vVV+gXrbuzEKrGKprbEimgMWYsizCN5Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BJS/gzlT85w+GcyJ6uuCZKJqUyRZVwZ2S5mfzsmaIgx/W99QLj3YJ47amWyuPfxbX tPP1KL3INZ3qLpD8AAcwFJZVo6cy0AozRcl94VGS8rADc9uFWdvOQ3RhYVqJIXzM5d HqsWa8btlnXt/5cMNEYKGAYNQlvQ69m38+3Z/tWg= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Matt Ranostay Subject: [PATCH 28/38] iio:chemical:vz89x: Introduce local struct device pointer. Date: Thu, 10 Sep 2020 18:32:32 +0100 Message-Id: <20200910173242.621168-29-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron Avoids lots of repition of &client->dev and will make the next patch tidier. Signed-off-by: Jonathan Cameron Cc: Matt Ranostay Acked-by: Matt Ranostay --- drivers/iio/chemical/vz89x.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/iio/chemical/vz89x.c b/drivers/iio/chemical/vz89x.c index 5586eb8e12cd..3cd469578590 100644 --- a/drivers/iio/chemical/vz89x.c +++ b/drivers/iio/chemical/vz89x.c @@ -352,12 +352,13 @@ MODULE_DEVICE_TABLE(of, vz89x_dt_ids); static int vz89x_probe(struct i2c_client *client, const struct i2c_device_id *id) { + struct device *dev = &client->dev; struct iio_dev *indio_dev; struct vz89x_data *data; const struct of_device_id *of_id; int chip_id; - indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data)); + indio_dev = devm_iio_device_alloc(dev, sizeof(*data)); if (!indio_dev) return -ENOMEM; data = iio_priv(indio_dev); @@ -370,7 +371,7 @@ static int vz89x_probe(struct i2c_client *client, else return -EOPNOTSUPP; - of_id = of_match_device(vz89x_dt_ids, &client->dev); + of_id = of_match_device(vz89x_dt_ids, dev); if (!of_id) chip_id = id->driver_data; else @@ -383,13 +384,13 @@ static int vz89x_probe(struct i2c_client *client, mutex_init(&data->lock); indio_dev->info = &vz89x_info; - indio_dev->name = dev_name(&client->dev); + indio_dev->name = dev_name(dev); indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->channels = data->chip->channels; indio_dev->num_channels = data->chip->num_channels; - return devm_iio_device_register(&client->dev, indio_dev); + return devm_iio_device_register(dev, indio_dev); } static const struct i2c_device_id vz89x_id[] = { From patchwork Thu Sep 10 17:32:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768367 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 78A85139F for ; Thu, 10 Sep 2020 17:39:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 52F7921582 for ; Thu, 10 Sep 2020 17:39:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759598; bh=whA4YHQvkK0isrTXudsdfk48GtxCvnci4OPZJuiK4Hg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=kxY1zLYJh1qvrugTlBfiasZQa6ilXwoOLsSmDr38UgRO3TFSFsPlmzHZ1btwtEwJf 4BRyNf2qL1ITuQk098eeXRK3m95JH0zlgRZ+4r/j1oBMWfxg4RmAh5zt7R+D3lH/Fc qxYKKlovzabk8ceYkYxtUCsKzbdbgs7L3YWK6wjw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726918AbgIJRjy (ORCPT ); Thu, 10 Sep 2020 13:39:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:48306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726663AbgIJRgw (ORCPT ); Thu, 10 Sep 2020 13:36:52 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 212C522224; Thu, 10 Sep 2020 17:35:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759352; bh=whA4YHQvkK0isrTXudsdfk48GtxCvnci4OPZJuiK4Hg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oddIwj1jsFDudYX2iLh5XVmh/WukmKaDMJIprwLJJJvfpmSLm3jDg95fr2ZI2StOI Y+u1ub8Gg+FLxKIkd7lwbpcYnGfhxZ+o4zXE9A3L1+8Ook3HLaZ81vDZ43RYSNcSm8 hrzJ7YQ1kyAnS8m5s+U9B8eTFWSnMJlVp2VjdS80= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Matt Ranostay Subject: [PATCH 29/38] iio:chemical:vz89x: Drop of_match_ptr protection and use generic fw accessors Date: Thu, 10 Sep 2020 18:32:33 +0100 Message-Id: <20200910173242.621168-30-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This change allow the driver to be used with ACPI PRP0001 and removes an antipattern that I want to avoid being copied into new IIO drivers. The handling of match_data uses a different approach as device_get_match_data() doesn't distinguish between no match, and a match but with NULL data. Signed-off-by: Jonathan Cameron Cc: Matt Ranostay Acked-by: Matt Ranostay --- drivers/iio/chemical/vz89x.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/iio/chemical/vz89x.c b/drivers/iio/chemical/vz89x.c index 3cd469578590..23b22a5f5c1c 100644 --- a/drivers/iio/chemical/vz89x.c +++ b/drivers/iio/chemical/vz89x.c @@ -10,8 +10,7 @@ #include #include #include -#include -#include +#include #include #include @@ -355,7 +354,6 @@ static int vz89x_probe(struct i2c_client *client, struct device *dev = &client->dev; struct iio_dev *indio_dev; struct vz89x_data *data; - const struct of_device_id *of_id; int chip_id; indio_dev = devm_iio_device_alloc(dev, sizeof(*data)); @@ -371,11 +369,10 @@ static int vz89x_probe(struct i2c_client *client, else return -EOPNOTSUPP; - of_id = of_match_device(vz89x_dt_ids, dev); - if (!of_id) + if (!dev_fwnode(dev)) chip_id = id->driver_data; else - chip_id = (unsigned long)of_id->data; + chip_id = (unsigned long)device_get_match_data(dev); i2c_set_clientdata(client, indio_dev); data->client = client; @@ -403,7 +400,7 @@ MODULE_DEVICE_TABLE(i2c, vz89x_id); static struct i2c_driver vz89x_driver = { .driver = { .name = "vz89x", - .of_match_table = of_match_ptr(vz89x_dt_ids), + .of_match_table = vz89x_dt_ids, }, .probe = vz89x_probe, .id_table = vz89x_id, From patchwork Thu Sep 10 17:32:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768345 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C7561139F for ; Thu, 10 Sep 2020 17:38:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A353021D81 for ; Thu, 10 Sep 2020 17:38:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759512; bh=ZXzliXGT/bnt7tne6KtQiVtQWVtaNAaHSzjfewyEpyQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KAQNUKHHWwvAB2GpDb6OBqoSo5bvsMPRkVpIXzroaGyXJEVymsMj9fYXhdYAqx+wP Jc0tnsbys1rjm0dxDn0qZWox3XWLf0qUS4adstu88Jv1YdcCywlZ5kPYarJfOQwvd7 hsA31PDMDb4CSnaAeNb5BrfsD/W3vJYmtD5SYppU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727871AbgIJRiL (ORCPT ); Thu, 10 Sep 2020 13:38:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:47978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726458AbgIJRhI (ORCPT ); Thu, 10 Sep 2020 13:37:08 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 812C221D81; Thu, 10 Sep 2020 17:35:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759353; bh=ZXzliXGT/bnt7tne6KtQiVtQWVtaNAaHSzjfewyEpyQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VibKZAx/2gNAg1JHi40xz1ojgcGrjpBnVOS7xHfUOX/hPBmT6JiBEEumCrTYHUB4J kY0uKRITyrxDwZgNDwLMsnrNBZJ941ZAs4EmxfYNAkvnUXx2YePXOklkQnHrCcgjFX ooyrop3nhtZxqWXDZ1+W7iNAluN6YRyS9UeKnNKA= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Matt Ranostay Subject: [PATCH 30/38] iio:humidity:hdc100x: Drop of_match_ptr protection. Date: Thu, 10 Sep 2020 18:32:34 +0100 Message-Id: <20200910173242.621168-31-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This prevents use of this driver with ACPI via PRP0001 and is an example of an anti pattern I'm trying to remove from IIO. Hence drop from this driver. Signed-off-by: Jonathan Cameron Cc: Matt Ranostay Acked-by: Matt Ranostay --- drivers/iio/humidity/hdc100x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/humidity/hdc100x.c b/drivers/iio/humidity/hdc100x.c index 071cb2b12bb6..2a957f19048e 100644 --- a/drivers/iio/humidity/hdc100x.c +++ b/drivers/iio/humidity/hdc100x.c @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -417,7 +418,7 @@ MODULE_DEVICE_TABLE(of, hdc100x_dt_ids); static struct i2c_driver hdc100x_driver = { .driver = { .name = "hdc100x", - .of_match_table = of_match_ptr(hdc100x_dt_ids), + .of_match_table = hdc100x_dt_ids, }, .probe = hdc100x_probe, .id_table = hdc100x_id, From patchwork Thu Sep 10 17:32:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768365 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5534C698 for ; Thu, 10 Sep 2020 17:39:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3ABAB206A1 for ; Thu, 10 Sep 2020 17:39:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759595; bh=JEW06y7qbjdix6iF0OHVUEjfJhAHopZUUAFHjSBar3A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=GtDk5dXyhSL5NoPnyFbCZmE4BOnFRNR1OmSUQTLU9EyqMCmyOBPrO+YkJnYMrxt6a 1AH54VQrfuQOeGU9o0IZoqwhyCPHrqtbXpplV0pA6mdlT5gon1hMSXiS3o4pqMqjQB kD+zQM3eDjC4R3tEA9qOBDFVADs0xQh0ZpYrUPYw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726846AbgIJRjv (ORCPT ); Thu, 10 Sep 2020 13:39:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:48608 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726918AbgIJRhI (ORCPT ); Thu, 10 Sep 2020 13:37:08 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D0F9722225; Thu, 10 Sep 2020 17:35:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759354; bh=JEW06y7qbjdix6iF0OHVUEjfJhAHopZUUAFHjSBar3A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MxzRkAiKyJHFmlqP1SSnItO+PSSIU6Jh5CJ7s3vKoxYEW/x4htUrxg7X4Af2tw8QR R6YrRdQf0V8lTqF+EgOVNOUfFapNqTqsTRc2KkRnBeRjOhgEwRW9Jvpr+z0anKkoA+ 9E3xAdeNnwcRGfqoqdxTCdNqhSSRratre4B5QIEQ= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Matt Ranostay Subject: [PATCH 31/38] iio:proximity:as3935: Use local struct device pointer to simplify code. Date: Thu, 10 Sep 2020 18:32:35 +0100 Message-Id: <20200910173242.621168-32-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This makes the existing code easier to read and will make the following patch a little simpler. Signed-off-by: Jonathan Cameron Cc: Matt Ranostay Acked-by: Matt Ranostay --- drivers/iio/proximity/as3935.c | 38 ++++++++++++++++------------------ 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/as3935.c index c339e7339ec8..4df8d53d65fb 100644 --- a/drivers/iio/proximity/as3935.c +++ b/drivers/iio/proximity/as3935.c @@ -352,19 +352,20 @@ static void as3935_stop_work(void *data) static int as3935_probe(struct spi_device *spi) { + struct device *dev = &spi->dev; struct iio_dev *indio_dev; struct iio_trigger *trig; struct as3935_state *st; - struct device_node *np = spi->dev.of_node; + struct device_node *np = dev->of_node; int ret; /* Be sure lightning event interrupt is specified */ if (!spi->irq) { - dev_err(&spi->dev, "unable to get event interrupt\n"); + dev_err(dev, "unable to get event interrupt\n"); return -EINVAL; } - indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); + indio_dev = devm_iio_device_alloc(dev, sizeof(*st)); if (!indio_dev) return -ENOMEM; @@ -378,14 +379,12 @@ static int as3935_probe(struct spi_device *spi) "ams,tuning-capacitor-pf", &st->tune_cap); if (ret) { st->tune_cap = 0; - dev_warn(&spi->dev, - "no tuning-capacitor-pf set, defaulting to %d", + dev_warn(dev, "no tuning-capacitor-pf set, defaulting to %d", st->tune_cap); } if (st->tune_cap > MAX_PF_CAP) { - dev_err(&spi->dev, - "wrong tuning-capacitor-pf setting of %d\n", + dev_err(dev, "wrong tuning-capacitor-pf setting of %d\n", st->tune_cap); return -EINVAL; } @@ -393,8 +392,7 @@ static int as3935_probe(struct spi_device *spi) ret = of_property_read_u32(np, "ams,nflwdth", &st->nflwdth_reg); if (!ret && st->nflwdth_reg > AS3935_NFLWDTH_MASK) { - dev_err(&spi->dev, - "invalid nflwdth setting of %d\n", + dev_err(dev, "invalid nflwdth setting of %d\n", st->nflwdth_reg); return -EINVAL; } @@ -405,7 +403,7 @@ static int as3935_probe(struct spi_device *spi) indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->info = &as3935_info; - trig = devm_iio_trigger_alloc(&spi->dev, "%s-dev%d", + trig = devm_iio_trigger_alloc(dev, "%s-dev%d", indio_dev->name, indio_dev->id); if (!trig) @@ -417,42 +415,42 @@ static int as3935_probe(struct spi_device *spi) iio_trigger_set_drvdata(trig, indio_dev); trig->ops = &iio_interrupt_trigger_ops; - ret = devm_iio_trigger_register(&spi->dev, trig); + ret = devm_iio_trigger_register(dev, trig); if (ret) { - dev_err(&spi->dev, "failed to register trigger\n"); + dev_err(dev, "failed to register trigger\n"); return ret; } - ret = devm_iio_triggered_buffer_setup(&spi->dev, indio_dev, + ret = devm_iio_triggered_buffer_setup(dev, indio_dev, iio_pollfunc_store_time, as3935_trigger_handler, NULL); if (ret) { - dev_err(&spi->dev, "cannot setup iio trigger\n"); + dev_err(dev, "cannot setup iio trigger\n"); return ret; } calibrate_as3935(st); INIT_DELAYED_WORK(&st->work, as3935_event_work); - ret = devm_add_action(&spi->dev, as3935_stop_work, indio_dev); + ret = devm_add_action(dev, as3935_stop_work, indio_dev); if (ret) return ret; - ret = devm_request_irq(&spi->dev, spi->irq, + ret = devm_request_irq(dev, spi->irq, &as3935_interrupt_handler, IRQF_TRIGGER_RISING, - dev_name(&spi->dev), + dev_name(dev), indio_dev); if (ret) { - dev_err(&spi->dev, "unable to request irq\n"); + dev_err(dev, "unable to request irq\n"); return ret; } - ret = devm_iio_device_register(&spi->dev, indio_dev); + ret = devm_iio_device_register(dev, indio_dev); if (ret < 0) { - dev_err(&spi->dev, "unable to register device\n"); + dev_err(dev, "unable to register device\n"); return ret; } return 0; From patchwork Thu Sep 10 17:32:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768361 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 60849698 for ; Thu, 10 Sep 2020 17:39:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3ABAE206A1 for ; Thu, 10 Sep 2020 17:39:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759591; bh=EgNyny7tY6Sx+fJIB487Wky48EnLP3lyv7nkTARfNC8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=2XLAUx5liCnzPsUHn0hJdRyhMfXCp0G8ko25/bN6APdZtmG+VHQvcEOrjV/SFoT8M gI+GW2UZjpMnnRqvQl+Red/8DXz8B3F9Da85yNiF+OGLMtQwar2BjadJSrpMEfty+S n4j30knM4KMRM/WnCb8/1jfALiF1ynV/NOCGxckA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726675AbgIJRjq (ORCPT ); Thu, 10 Sep 2020 13:39:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:47892 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727032AbgIJRhL (ORCPT ); Thu, 10 Sep 2020 13:37:11 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 38B1B22226; Thu, 10 Sep 2020 17:35:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759356; bh=EgNyny7tY6Sx+fJIB487Wky48EnLP3lyv7nkTARfNC8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WXEvF0qpNCXdGDcULruKFQ+84fLfAjtxTjiHv5lewR0fTDUVgO0WiQiCX0cRBMpj7 1mesaUGIZtpED1Th5gFlgomMGy5C2wwbzsL8UOSFZZ7bEMze8ZDWkPEdlwVEonoE78 s5SwTjmlmGyNDuysXyJ2kebZ9Ds8aRSM5nRTl9ik= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Matt Ranostay Subject: [PATCH 32/38] iio:proximity:as3935: Drop of_match_ptr and use generic fw accessors Date: Thu, 10 Sep 2020 18:32:36 +0100 Message-Id: <20200910173242.621168-33-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This change allows the driver to be used with ACPI PRP0001 and removes an antipattern that I want to avoid being copied into new IIO drivers. Signed-off-by: Jonathan Cameron Cc: Matt Ranostay Acked-by: Matt Ranostay --- drivers/iio/proximity/as3935.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/as3935.c index 4df8d53d65fb..b79ada839e01 100644 --- a/drivers/iio/proximity/as3935.c +++ b/drivers/iio/proximity/as3935.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -356,7 +357,6 @@ static int as3935_probe(struct spi_device *spi) struct iio_dev *indio_dev; struct iio_trigger *trig; struct as3935_state *st; - struct device_node *np = dev->of_node; int ret; /* Be sure lightning event interrupt is specified */ @@ -375,7 +375,7 @@ static int as3935_probe(struct spi_device *spi) spi_set_drvdata(spi, indio_dev); mutex_init(&st->lock); - ret = of_property_read_u32(np, + ret = device_property_read_u32(dev, "ams,tuning-capacitor-pf", &st->tune_cap); if (ret) { st->tune_cap = 0; @@ -389,7 +389,7 @@ static int as3935_probe(struct spi_device *spi) return -EINVAL; } - ret = of_property_read_u32(np, + ret = device_property_read_u32(dev, "ams,nflwdth", &st->nflwdth_reg); if (!ret && st->nflwdth_reg > AS3935_NFLWDTH_MASK) { dev_err(dev, "invalid nflwdth setting of %d\n", @@ -471,7 +471,7 @@ MODULE_DEVICE_TABLE(spi, as3935_id); static struct spi_driver as3935_driver = { .driver = { .name = "as3935", - .of_match_table = of_match_ptr(as3935_of_match), + .of_match_table = as3935_of_match, .pm = AS3935_PM_OPS, }, .probe = as3935_probe, From patchwork Thu Sep 10 17:32:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768363 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0DCB7698 for ; Thu, 10 Sep 2020 17:39:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DEAF921582 for ; Thu, 10 Sep 2020 17:39:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759594; bh=SgAGLStXgQ7w2KnWMGzPUyRVQ4AEGbSy8kysWBWhcJE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=lvFWl0/3PNRlDKuyW6I4wG2CbZu/JZrGOkdRBJiHp6dYiCCMjH9hyy0P6JGDXgvQP 2kUtlxKFTEAcA/qIddr8PjiqezSROJuVCPXxtgYMjp4KZEYyXazoXdt6RKRExd35u1 SN+wA0sGk8vhmYkhYXX4hV7BRd82sPaEqRdYe6Ws= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726811AbgIJRjr (ORCPT ); Thu, 10 Sep 2020 13:39:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:48630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727109AbgIJRhL (ORCPT ); Thu, 10 Sep 2020 13:37:11 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8FA8921D40; Thu, 10 Sep 2020 17:35:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759357; bh=SgAGLStXgQ7w2KnWMGzPUyRVQ4AEGbSy8kysWBWhcJE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k/BP6CCPPFG+dhwkfNZbRoHkLpcp/X1bgo+IhSygxd/TuSTvBrVobBAADk0PsCWW2 BZ0N0wFDGzalfLzVSX1jwXIkadDtfDe79w1yHQT1abB9jvqVzeaC2TOLwku50PMECY crAHsg3IDAXx8L3qkqVqOfw2EAt1Woyh2AzJBpsk= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Matt Ranostay Subject: [PATCH 33/38] iio:proximity:pulsedlight: Drop of_match_ptr protection Date: Thu, 10 Sep 2020 18:32:37 +0100 Message-Id: <20200910173242.621168-34-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This prevents use of this driver with ACPI via PRP0001 and is an example of an anti pattern I'm trying to remove from IIO. Hence drop from this driver. Signed-off-by: Jonathan Cameron Cc: Matt Ranostay Acked-by: Matt Ranostay --- drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c index a8e716dbd24e..c685f10b5ae4 100644 --- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c +++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -360,7 +361,7 @@ static const struct dev_pm_ops lidar_pm_ops = { static struct i2c_driver lidar_driver = { .driver = { .name = LIDAR_DRV_NAME, - .of_match_table = of_match_ptr(lidar_dt_ids), + .of_match_table = lidar_dt_ids, .pm = &lidar_pm_ops, }, .probe = lidar_probe, From patchwork Thu Sep 10 17:32:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768359 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 07128139F for ; Thu, 10 Sep 2020 17:39:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DAC4E206A1 for ; Thu, 10 Sep 2020 17:39:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759589; bh=blQOhietSGkdIajSqFJS++7Xp/W+W41PAK7v1JvlG3A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=XVe+uknuzOzKqbCnyfOA1dZOVgbbWN2r4RhgVHM79z9fZzLG2+lfNM2+nYSX5CCFP L1AZrqHBEpiCAnZCdT88mHmJiMZwwxYfI63466kRm/yn7srM3R3mfSrjjqaGlKF/8P x7KuyuTUz2e1WcUy4mpV42mtpxG/QVt5/KRJGxVE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726384AbgIJRjq (ORCPT ); Thu, 10 Sep 2020 13:39:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:47928 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726675AbgIJRhN (ORCPT ); Thu, 10 Sep 2020 13:37:13 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E283822228; Thu, 10 Sep 2020 17:35:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759358; bh=blQOhietSGkdIajSqFJS++7Xp/W+W41PAK7v1JvlG3A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yy7i8C4iYkSWwEK4wkxnFnRR5CCeof7b0xHNTa1WFD2a2XFcgJpYQmoEitRWs/Yak 1hZ4UbkuqpO2EzMRpadOhB7N1cfRWZnLaPbCu4Ujbv8XEr2fhhm+GRLIig+eJ4riUo bbqOZVdsXeOyRXVtWedUIuoK61mfwSrlV72v3mUY= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Jonathan Albrieux Subject: [PATCH 34/38] iio:magn:ak8975: Drop of_match_ptr and ACPI_PTR protections. Date: Thu, 10 Sep 2020 18:32:38 +0100 Message-Id: <20200910173242.621168-35-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron Both would result in only a small size saving. For simplicity it is best to remove them. I also wish to remove both these antipatterns from IIO. Signed-off-by: Jonathan Cameron Cc: Jonathan Albrieux Acked-by: Jonathan Albrieux Tested-by: Jonathan Albrieux --- drivers/iio/magnetometer/ak8975.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c index 03d71f796177..0141ef3b6476 100644 --- a/drivers/iio/magnetometer/ak8975.c +++ b/drivers/iio/magnetometer/ak8975.c @@ -8,6 +8,7 @@ */ #include +#include #include #include #include @@ -17,7 +18,6 @@ #include #include #include -#include #include #include @@ -773,7 +773,6 @@ static const struct iio_info ak8975_info = { .read_raw = &ak8975_read_raw, }; -#ifdef CONFIG_ACPI static const struct acpi_device_id ak_acpi_match[] = { {"AK8975", AK8975}, {"AK8963", AK8963}, @@ -785,7 +784,6 @@ static const struct acpi_device_id ak_acpi_match[] = { { } }; MODULE_DEVICE_TABLE(acpi, ak_acpi_match); -#endif static void ak8975_fill_buffer(struct iio_dev *indio_dev) { @@ -1075,8 +1073,8 @@ static struct i2c_driver ak8975_driver = { .driver = { .name = "ak8975", .pm = &ak8975_dev_pm_ops, - .of_match_table = of_match_ptr(ak8975_of_match), - .acpi_match_table = ACPI_PTR(ak_acpi_match), + .of_match_table = ak8975_of_match, + .acpi_match_table = ak_acpi_match, }, .probe = ak8975_probe, .remove = ak8975_remove, From patchwork Thu Sep 10 17:32:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768357 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A3172139F for ; Thu, 10 Sep 2020 17:39:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7DBBA21582 for ; Thu, 10 Sep 2020 17:39:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759587; bh=8m9Eu5Z7l1WDp5n3jN0PlW09xmryAEuUQvPXhf1s5o4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=zgcUK/vWGR5m5pX9ADQCFqQNKT7k/RZLYVZMOqgUY67ivt7OYp7VRRaZ4Jpni4nGb S4lsPStErH6saqQJtPaIea+a9ybDaa5RtOQBWlDLSeYO0VFV/wo+u25dakden3h9TP pFqnkuKYIXoXqPdF8ZzqrKwtIu0sJLn+X5bn6P3g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726419AbgIJRjq (ORCPT ); Thu, 10 Sep 2020 13:39:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:47926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727119AbgIJRhO (ORCPT ); Thu, 10 Sep 2020 13:37:14 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7908A22229; Thu, 10 Sep 2020 17:35:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759360; bh=8m9Eu5Z7l1WDp5n3jN0PlW09xmryAEuUQvPXhf1s5o4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=griBLVZzTz2/sRHoA4uqbMn4WKm6oP3a2iwOyhgTo3GDKRFgFTDTkDPE9Yi1KNFPR rqpO7hKXGkzzUKAvQx3pgHmpmgUJBRn4/nXHy46EmnApiSm4jv7p647etSD2gPk34f yvEh75ZM3zQLtm1AhZcwyT6QjXqYL0DEGhYypPCA= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Linus Walleij Subject: [PATCH 35/38] iio:magn:ak8974: Drop of_match_ptr protection Date: Thu, 10 Sep 2020 18:32:39 +0100 Message-Id: <20200910173242.621168-36-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This prevents use of this driver with ACPI via PRP0001 and is an example of an anti pattern I'm trying to remove from IIO. Hence drop from this driver. Signed-off-by: Jonathan Cameron Cc: Linus Walleij Reviewed-by: Linus Walleij --- drivers/iio/magnetometer/ak8974.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c index 7cd9768fbcb2..df5131cf28a9 100644 --- a/drivers/iio/magnetometer/ak8974.c +++ b/drivers/iio/magnetometer/ak8974.c @@ -12,6 +12,7 @@ * Author: Linus Walleij */ #include +#include #include #include #include @@ -1051,7 +1052,7 @@ static struct i2c_driver ak8974_driver = { .driver = { .name = "ak8974", .pm = &ak8974_dev_pm_ops, - .of_match_table = of_match_ptr(ak8974_of_match), + .of_match_table = ak8974_of_match, }, .probe = ak8974_probe, .remove = ak8974_remove, From patchwork Thu Sep 10 17:32:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768353 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5AC06139F for ; Thu, 10 Sep 2020 17:39:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 356D6206A1 for ; Thu, 10 Sep 2020 17:39:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759578; bh=FqgkTVreN1ipDWL7ab+JQMxKaDz/ngXvroDhh/hGK2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=T6FN00LGKroHWJncQLzaYWr26yGIA0LKefvURXFkxTlLdj9qmSIpbQXcK0JMXW6nG RHUxFg4el+PAkfGeo0OzywQ1plS+R8bBcq9/WHlLLoCDNYa9EYpxkvjqgI5lSPNViA HcBX5KD6uAgFVdoiZzXVgiFGLm4DABSjNsR81q78= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727796AbgIJRjN (ORCPT ); Thu, 10 Sep 2020 13:39:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:47974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725965AbgIJRhX (ORCPT ); Thu, 10 Sep 2020 13:37:23 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CBD1E22227; Thu, 10 Sep 2020 17:36:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759361; bh=FqgkTVreN1ipDWL7ab+JQMxKaDz/ngXvroDhh/hGK2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bMWAMhujIIDX04tW3FBSbnlIq643tuafP+L5zA0Iwn7HOFG9KsChEFo6cs90NRt3A TT+0AEpvpPUwazncKUAifpDSNz2w3W2uUNqvfjjuwjOQ3LE9s1mir9oTgu+/+7OXBE 8zizrKZcXSEfOsqbFd09usljMb7tWMXNVGTLdEoE= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Ludovic Tancerel Subject: [PATCH 36/38] iio:humidity:htu21: Drop of_match_ptr protection Date: Thu, 10 Sep 2020 18:32:40 +0100 Message-Id: <20200910173242.621168-37-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This prevents use of this driver with ACPI via PRP0001 and is an example of an anti pattern I'm trying to remove from IIO. Hence drop from this driver. Signed-off-by: Jonathan Cameron Cc: Ludovic Tancerel --- drivers/iio/humidity/htu21.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/humidity/htu21.c b/drivers/iio/humidity/htu21.c index 4f5d9d1c05ab..36df2a102ca4 100644 --- a/drivers/iio/humidity/htu21.c +++ b/drivers/iio/humidity/htu21.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -247,7 +248,7 @@ static struct i2c_driver htu21_driver = { .id_table = htu21_id, .driver = { .name = "htu21", - .of_match_table = of_match_ptr(htu21_of_match), + .of_match_table = htu21_of_match, }, }; From patchwork Thu Sep 10 17:32:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768351 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB93A698 for ; Thu, 10 Sep 2020 17:39:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 864CC206A1 for ; Thu, 10 Sep 2020 17:39:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759562; bh=NjmG4Fc74UkPx3ip1qe+lntc+QQRDs/tlprA2yXq8bo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=NBbeLQV1VZoZR9zd2SS8d0eS/7knVNS5jpME9lWUXgJBEYRvBhm4qYh62OFisE4Df UJAS/7I0hsUN7mttWdrck4a6Ex6Ysrt+EBiP0WJlas9xKCOlVMZI/svyVjJDV/h+kj BSmNZBu3qWTnZGj+cf9bAr31LfRlJfseW1bNgf+I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726005AbgIJRjT (ORCPT ); Thu, 10 Sep 2020 13:39:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:47772 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727838AbgIJRh3 (ORCPT ); Thu, 10 Sep 2020 13:37:29 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2A5EA2222A; Thu, 10 Sep 2020 17:36:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759363; bh=NjmG4Fc74UkPx3ip1qe+lntc+QQRDs/tlprA2yXq8bo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P7YJ+HBpaM+3ovPl5EK0JP+dZd6yMoG9JfuAvrSJs5/ZGc0FbMeZJ4/uA1bDl3a6g z0dQ8giUHUDDBBpgxZ0lJX7jPOm2aNs7+6rjLKzZD+o1xyqUP2mlNMCpMBes4wei4k 06Y70WEJwaQar38yU6v58P3q+SuAL0ER8RkDrZ/8= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , David Barksdale Subject: [PATCH 37/38] iio:humidity:si7020: Drop of_match_ptr protection Date: Thu, 10 Sep 2020 18:32:41 +0100 Message-Id: <20200910173242.621168-38-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This prevents use of this driver with ACPI via PRP0001 and is an example of an anti pattern I'm trying to remove from IIO. Hence drop from this driver. Signed-off-by: Jonathan Cameron Cc: David Barksdale --- drivers/iio/humidity/si7020.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/humidity/si7020.c b/drivers/iio/humidity/si7020.c index a09b5773d377..ab6537f136ba 100644 --- a/drivers/iio/humidity/si7020.c +++ b/drivers/iio/humidity/si7020.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -153,7 +154,7 @@ MODULE_DEVICE_TABLE(of, si7020_dt_ids); static struct i2c_driver si7020_driver = { .driver = { .name = "si7020", - .of_match_table = of_match_ptr(si7020_dt_ids), + .of_match_table = si7020_dt_ids, }, .probe = si7020_probe, .id_table = si7020_id, From patchwork Thu Sep 10 17:32:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11768355 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 244B6698 for ; Thu, 10 Sep 2020 17:39:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 07BD0206A1 for ; Thu, 10 Sep 2020 17:39:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759581; bh=hPyt21/+/dzyq2e1Ad7oyy9C4nHZn+khIrRfxc6UA3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=jO5sw6Ox8MgEyb45daCwqArhrG4ZUv+ZLnJeU2IPYgktMEyHufmVJmoxT2+aB/ysu 3uvlPHNKiR/ZNHBEZsWjwxRAA9j0jaVLCV0UfSN3gR1c/Uq01KW9Q+oiMcmJD2YQxl L7M1gQMnPjfuWM5JKTTQCaY5UnAMb+kN1EmztjlU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727089AbgIJRjK (ORCPT ); Thu, 10 Sep 2020 13:39:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:47868 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727857AbgIJRhm (ORCPT ); Thu, 10 Sep 2020 13:37:42 -0400 Received: from localhost.localdomain (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 828EB2222C; Thu, 10 Sep 2020 17:36:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599759364; bh=hPyt21/+/dzyq2e1Ad7oyy9C4nHZn+khIrRfxc6UA3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t6srSpKvmM45xEokP7P0uIH/jVtLwYptI8SocKupXb1rrMLfGu52aUFrpJ/sS61Zw prygQzh02NUGVhrSW3keE3zkjTT5FM3uH/PfQrySz9VWB+5sPvYlrk/zcGoSHXN8a9 DWyqjpro2pHaFLpdNr42+QHdKVe+0hMAv4XAZziA= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Matt Ranostay Subject: [PATCH 38/38] iio:health:max30102: Drop of_match_ptr and use generic fw accessors Date: Thu, 10 Sep 2020 18:32:42 +0100 Message-Id: <20200910173242.621168-39-jic23@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910173242.621168-1-jic23@kernel.org> References: <20200910173242.621168-1-jic23@kernel.org> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This enables use of the driver with ACPI PRP0001 and also removes an antipattern that I am trying to clear out of IIO to avoid it being coppied into new drivers. Signed-off-by: Jonathan Cameron Cc: Matt Ranostay Acked-by: Matt Ranostay --- drivers/iio/health/max30102.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/iio/health/max30102.c b/drivers/iio/health/max30102.c index bb504e993f19..543021d8df34 100644 --- a/drivers/iio/health/max30102.c +++ b/drivers/iio/health/max30102.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -323,11 +323,10 @@ static int max30102_get_current_idx(unsigned int val, int *reg) static int max30102_led_init(struct max30102_data *data) { struct device *dev = &data->client->dev; - struct device_node *np = dev->of_node; unsigned int val; int reg, ret; - ret = of_property_read_u32(np, "maxim,red-led-current-microamp", &val); + ret = device_property_read_u32(dev, "maxim,red-led-current-microamp", &val); if (ret) { dev_info(dev, "no red-led-current-microamp set\n"); @@ -346,7 +345,7 @@ static int max30102_led_init(struct max30102_data *data) return ret; if (data->chip_id == max30105) { - ret = of_property_read_u32(np, + ret = device_property_read_u32(dev, "maxim,green-led-current-microamp", &val); if (ret) { dev_info(dev, "no green-led-current-microamp set\n"); @@ -368,7 +367,7 @@ static int max30102_led_init(struct max30102_data *data) return ret; } - ret = of_property_read_u32(np, "maxim,ir-led-current-microamp", &val); + ret = device_property_read_u32(dev, "maxim,ir-led-current-microamp", &val); if (ret) { dev_info(dev, "no ir-led-current-microamp set\n"); @@ -624,7 +623,7 @@ MODULE_DEVICE_TABLE(of, max30102_dt_ids); static struct i2c_driver max30102_driver = { .driver = { .name = MAX30102_DRV_NAME, - .of_match_table = of_match_ptr(max30102_dt_ids), + .of_match_table = max30102_dt_ids, }, .probe = max30102_probe, .remove = max30102_remove,