From patchwork Sun Jun 28 12:36: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: 11630091 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 1A15014B7 for ; Sun, 28 Jun 2020 12:39:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ECFDD208B6 for ; Sun, 28 Jun 2020 12:39:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347942; bh=Cz7K3AIcHR1ju60+moItSF+IFx6ukxJN/DTrE0HQDXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=e7ZdRFlPqXoSF+SmWdP+84rDlhJGRf0OZGFyimYZs14ioHcEH+lOm6kGzM9/aRV5j a/qI4BCwZ5gB1i+GmZoWWtbtf23hDdZLf23PCIxHCMssKvGxmVu8DpZvjwrE37zdct 22CthQ4c1q/38oD1DpAjr6WmfMkoHUD6jv90YbDg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726342AbgF1MjB (ORCPT ); Sun, 28 Jun 2020 08:39:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:53038 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726373AbgF1MjA (ORCPT ); Sun, 28 Jun 2020 08:39: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 E88F320760; Sun, 28 Jun 2020 12:38:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347940; bh=Cz7K3AIcHR1ju60+moItSF+IFx6ukxJN/DTrE0HQDXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wQIjdBVBocTYgL1sYSDQBcIhgJLi/AfewDlXG7LWJOK+yL/PQ2Uv2rYCSeXgw+8RR WBQVPYOCrmZ60XbbzupHG/70zOG1nOZFhaCCJMozXBvzdNtMXwvzpwGBRsAS6oh4rp sAD5OK3imZU5kGGtwRiu7H2qvBazb1mcRdutb0v8= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron Subject: [PATCH 01/23] iio:adc:lpc32xx: Drop of_match_ptr protection Date: Sun, 28 Jun 2020 13:36:32 +0100 Message-Id: <20200628123654.32830-2-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 Whilst is unlikely anyone will be using this part with an ACPI PRP0001 based binding any time soon, we are getting a lot of cut and pasting of this pattern so I am looking to remove it entirely from IIO. In this case CONFIG_OF protections also removed and mod_devicetable.h include added given direct use of struct of_device_id. Signed-off-by: Jonathan Cameron --- drivers/iio/adc/lpc32xx_adc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/lpc32xx_adc.c b/drivers/iio/adc/lpc32xx_adc.c index bc2712a48844..b56ce15255cf 100644 --- a/drivers/iio/adc/lpc32xx_adc.c +++ b/drivers/iio/adc/lpc32xx_adc.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -209,19 +210,17 @@ static int lpc32xx_adc_probe(struct platform_device *pdev) return 0; } -#ifdef CONFIG_OF static const struct of_device_id lpc32xx_adc_match[] = { { .compatible = "nxp,lpc3220-adc" }, {}, }; MODULE_DEVICE_TABLE(of, lpc32xx_adc_match); -#endif static struct platform_driver lpc32xx_adc_driver = { .probe = lpc32xx_adc_probe, .driver = { .name = LPC32XXAD_NAME, - .of_match_table = of_match_ptr(lpc32xx_adc_match), + .of_match_table = lpc32xx_adc_match, }, }; From patchwork Sun Jun 28 12:36: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: 11630093 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 D31C514B7 for ; Sun, 28 Jun 2020 12:39:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B1D69208B6 for ; Sun, 28 Jun 2020 12:39:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347943; bh=/Qf8gugZ0WrxWXmQYsy7G+9WT6NXIebrWHudXpJRVq8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=FS15GxiOVFsilmMVH8Aq2coTkTsonWCARNlrlRK3OF4eTvjZtNIE4vM1gjgNOySQt ht3jePauJUkgh0gg60hVp9+xT4drywAUApJVI96TY4WoYPef2SngCd7UyAizIttEKc UyYvROMXTB9AXNKMB207BP86LmSUfv0KHp7dhDaA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726412AbgF1MjC (ORCPT ); Sun, 28 Jun 2020 08:39:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:53054 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726373AbgF1MjC (ORCPT ); Sun, 28 Jun 2020 08:39:02 -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 2EB6C2076E; Sun, 28 Jun 2020 12:39:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347942; bh=/Qf8gugZ0WrxWXmQYsy7G+9WT6NXIebrWHudXpJRVq8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xt1aT7Xv9IDYGyYRWmnS+M8laDAJlFPrk3Ggohr78NABJDctyR7vdEMW4Ifzi1NEx qgK/zYb67jGpmpGWnujEyYOkmugoJyvbmnR9OPLjmRIl5puj4gMCtzPdh80MrYHpSR IROj/VVBDkDpgqfBxVKJ6/sjqzk7FmvwQ1zztFJA= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron , Quentin Schulz Subject: [PATCH 02/23] iio:adc:axp20x: Convert from OF to generic fw / device properties Date: Sun, 28 Jun 2020 13:36:33 +0100 Message-Id: <20200628123654.32830-3-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 Whilst fairly unlikely anyone will ever use this driver with anything other than DT, we are trying to move IIO over to the generic interfaces where easy to do so. In this case this involved moving to generic check on presence of fw_node, generic device_get_match_data and dropping the of_match_ptr protection. Also relevant header changes to have property.h and mod_devicetable.h only. Signed-off-by: Jonathan Cameron Cc: Quentin Schulz --- drivers/iio/adc/axp20x_adc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/iio/adc/axp20x_adc.c b/drivers/iio/adc/axp20x_adc.c index 798ff2d89691..b678f897d983 100644 --- a/drivers/iio/adc/axp20x_adc.c +++ b/drivers/iio/adc/axp20x_adc.c @@ -9,10 +9,10 @@ #include #include #include -#include -#include +#include #include #include +#include #include #include @@ -670,7 +670,7 @@ static int axp20x_probe(struct platform_device *pdev) info->regmap = axp20x_dev->regmap; indio_dev->modes = INDIO_DIRECT_MODE; - if (!pdev->dev.of_node) { + if (!dev_fwnode(&pdev->dev)) { const struct platform_device_id *id; id = platform_get_device_id(pdev); @@ -678,7 +678,7 @@ static int axp20x_probe(struct platform_device *pdev) } else { struct device *dev = &pdev->dev; - info->data = (struct axp_data *)of_device_get_match_data(dev); + info->data = (struct axp_data *)device_get_match_data(dev); } indio_dev->name = platform_get_device_id(pdev)->name; @@ -742,7 +742,7 @@ static int axp20x_remove(struct platform_device *pdev) static struct platform_driver axp20x_adc_driver = { .driver = { .name = "axp20x-adc", - .of_match_table = of_match_ptr(axp20x_adc_of_match), + .of_match_table = axp20x_adc_of_match, }, .id_table = axp20x_adc_id_match, .probe = axp20x_probe, From patchwork Sun Jun 28 12:36: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: 11630095 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 DB8A513B4 for ; Sun, 28 Jun 2020 12:39:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C3197208C7 for ; Sun, 28 Jun 2020 12:39:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347944; bh=mBpR4+1rGqD4HDEtxnq9PHSdaeSSVRt0zkY0vwIasd8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ke4qNwe76um5jnWyWrxL/cpkYDKzDbCk9d+lA4yUjTu6adsIWm/wvVxKgd6KDdHNj OcJ1k9fZ7uSpiExGpmb+a9jt3TqWlk1PsUA2ohlvAafBRKnay22R69kwhOZKgQQiIK ZNain58GHhQl18zr45y3TvFR8udvk0pNS+Tn405g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726426AbgF1MjE (ORCPT ); Sun, 28 Jun 2020 08:39:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:53064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726373AbgF1MjD (ORCPT ); Sun, 28 Jun 2020 08:39:03 -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 91ACE20885; Sun, 28 Jun 2020 12:39:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347943; bh=mBpR4+1rGqD4HDEtxnq9PHSdaeSSVRt0zkY0vwIasd8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mBFCxAA7bK5YVx91gPRoNQHC72WE5cheBXvZIYgge0+zjXUbYyHtcYddSofHkxBG/ ywJB/h23kybo0eqxFA2nzGoO2H+TnIxb4OuY4QJA9oAOxeUDbmrXmmv0MnbrTfV8Fy aLFhs/gNvjiO9XtRRTgzCmQpQDgayW8zancmaT9w= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron , Nikita Yushchenko , Vladimir Barinov Subject: [PATCH 03/23] iio:adc:hi8435: Drop unused of_gpio.h header Date: Sun, 28 Jun 2020 13:36:34 +0100 Message-Id: <20200628123654.32830-4-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 I guess this is a left over from some earlier cleanup. Not used currently. Signed-off-by: Jonathan Cameron Cc: Nikita Yushchenko Cc: Vladimir Barinov --- drivers/iio/adc/hi8435.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/iio/adc/hi8435.c b/drivers/iio/adc/hi8435.c index 127e78243233..235374ec7bab 100644 --- a/drivers/iio/adc/hi8435.c +++ b/drivers/iio/adc/hi8435.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include From patchwork Sun Jun 28 12:36: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: 11630097 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 B52AA13B4 for ; Sun, 28 Jun 2020 12:39:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9595820885 for ; Sun, 28 Jun 2020 12:39:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347946; bh=wg5Pg+8P6WOTrxR8szcB8s+eO4PjjMh9OumP07CxuHQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=nwWGY7ENL4GcjCkred0+KVENnkZ2cII/ut+TOEZeeSR0ibs6eVMc3NUSD6/o3FL9P ozRqGIvDMGZAKcYrKViuCCuFUrlwIqirgVlxpo/IOzFHNii4bm3iN0/K6hweobLx6w 5mlTqBLPYOEAGmBd4jnRt9hbrx8uD94SHLXIKVj0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726473AbgF1MjF (ORCPT ); Sun, 28 Jun 2020 08:39:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:53090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726373AbgF1MjF (ORCPT ); Sun, 28 Jun 2020 08:39:05 -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 22C4B208B6; Sun, 28 Jun 2020 12:39:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347945; bh=wg5Pg+8P6WOTrxR8szcB8s+eO4PjjMh9OumP07CxuHQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hT8JXES9ySwnNfY27ktTRt2Toslb6h1TBpGdHFoCfa0xO95N1W7/f0owap+aEJ2mq lJEKcFQf3RzhRaXdpOUnxutt3FSHiqhNgqyRwSyIvoV1rdJaOMrQXC5+c/oDF1l4d9 hE/WYNGHrTtX2epU0bvBTJAeVfU/uMPOIJwGlmXo= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron , Vladimir Barinov , Nikita Yushchenko Subject: [PATCH 04/23] iio:adc:hi8435: Drop of_match_ptr protection. Date: Sun, 28 Jun 2020 13:36:35 +0100 Message-Id: <20200628123654.32830-5-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 Allows use of ACPI with PRP0001 and is generally something we are trying to avoid having people cut and paste into new drivers without thinking about it. Signed-off-by: Jonathan Cameron Cc: Vladimir Barinov Cc: Nikita Yushchenko --- drivers/iio/adc/hi8435.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/hi8435.c b/drivers/iio/adc/hi8435.c index 235374ec7bab..074c30970465 100644 --- a/drivers/iio/adc/hi8435.c +++ b/drivers/iio/adc/hi8435.c @@ -15,8 +15,7 @@ #include #include #include -#include -#include +#include #include #include @@ -539,7 +538,7 @@ MODULE_DEVICE_TABLE(spi, hi8435_id); static struct spi_driver hi8435_driver = { .driver = { .name = DRV_NAME, - .of_match_table = of_match_ptr(hi8435_dt_ids), + .of_match_table = hi8435_dt_ids, }, .probe = hi8435_probe, .id_table = hi8435_id, From patchwork Sun Jun 28 12:36: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: 11630099 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 E8B9E14B7 for ; Sun, 28 Jun 2020 12:39:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C7CF620885 for ; Sun, 28 Jun 2020 12:39:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347947; bh=cyIhB9UJiXDOtLIWMJ2O9p1GGj0vCZZv7qByZCulUIs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=qa8U0jW+rGH8p3uWCnELiVYslqYryV+ddnotQP0yXi5BlIuzHQ5oPqeF3z2fL60V9 h61cNT89psTLits0V09QW/hcnfsJuXclB3vNZpQAYvrsd/6WjrOiMx+0O/yx7NYUXm uFdjiv7pa8nvs1lf01hM6AnGihxWDVE3dXG05kuA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726316AbgF1MjH (ORCPT ); Sun, 28 Jun 2020 08:39:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:53100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726373AbgF1MjG (ORCPT ); Sun, 28 Jun 2020 08:39:06 -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 A56AE20738; Sun, 28 Jun 2020 12:39:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347946; bh=cyIhB9UJiXDOtLIWMJ2O9p1GGj0vCZZv7qByZCulUIs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=veldQ0N9Xg/gvBQVxnw+R+/B36XoFvWjL+CLTJlTK+mdiEuu5QZZGYbC80ODblikn tdHKSQ3pERtxigZa1MUgneiv4WDgO0OPJKOsCv7f3AiJiUT8ibElGTD8yVI6MIigDY JCYHTJyZdkkMzthZoBAGdyUhVGtAryUGIav6tUiA= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron Subject: [PATCH 05/23] iio:adc:max1363: Drop of_match_ptr and use generic device_get_match_data Date: Sun, 28 Jun 2020 13:36:36 +0100 Message-Id: <20200628123654.32830-6-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 Allows driver to use ACPI PRP0001 binding and there was no particular advantage in having the protections in this driver. Mostly this part of an effort to remove as many OF specific bits of handling from IIO and use the generic forms where possible. Signed-off-by: Jonathan Cameron --- drivers/iio/adc/max1363.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/iio/adc/max1363.c b/drivers/iio/adc/max1363.c index d8da5da74b77..420e2ec154fc 100644 --- a/drivers/iio/adc/max1363.c +++ b/drivers/iio/adc/max1363.c @@ -22,8 +22,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -1529,8 +1529,6 @@ static irqreturn_t max1363_trigger_handler(int irq, void *p) return IRQ_HANDLED; } -#ifdef CONFIG_OF - #define MAX1363_COMPATIBLE(of_compatible, cfg) { \ .compatible = of_compatible, \ .data = &max1363_chip_info_tbl[cfg], \ @@ -1578,7 +1576,6 @@ static const struct of_device_id max1363_of_match[] = { { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, max1363_of_match); -#endif static int max1363_probe(struct i2c_client *client, const struct i2c_device_id *id) @@ -1613,7 +1610,7 @@ static int max1363_probe(struct i2c_client *client, /* this is only used for device removal purposes */ i2c_set_clientdata(client, indio_dev); - st->chip_info = of_device_get_match_data(&client->dev); + st->chip_info = device_get_match_data(&client->dev); if (!st->chip_info) st->chip_info = &max1363_chip_info_tbl[id->driver_data]; st->client = client; @@ -1756,7 +1753,7 @@ MODULE_DEVICE_TABLE(i2c, max1363_id); static struct i2c_driver max1363_driver = { .driver = { .name = "max1363", - .of_match_table = of_match_ptr(max1363_of_match), + .of_match_table = max1363_of_match, }, .probe = max1363_probe, .remove = max1363_remove, From patchwork Sun Jun 28 12:36: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: 11630101 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 719F314B7 for ; Sun, 28 Jun 2020 12:39:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4CF5820738 for ; Sun, 28 Jun 2020 12:39:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347949; bh=vqys9J+CxZpDqKWoLrfc42E8xFmtZolr4+PnOPt17CM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=H0YK3zHeT3GRZor74JVlBDxopD6o/VUpRXWA5fGBMdDiZLAlfOpY9jEJ2ZyRmjbpG HKZjrZToI+3yz9zdsQw7yr4qfVfuzq4OMlnWUkkVudNMxKE4PFDNidTt/7UBd2QA+f v4iJhxpXghMY5qSYboZjN0HQyqNpjUBmmRU+nPek= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726503AbgF1MjI (ORCPT ); Sun, 28 Jun 2020 08:39:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:53116 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726373AbgF1MjI (ORCPT ); Sun, 28 Jun 2020 08:39: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 DE85C2076E; Sun, 28 Jun 2020 12:39:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347948; bh=vqys9J+CxZpDqKWoLrfc42E8xFmtZolr4+PnOPt17CM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M8PqMW1fVjd1Tv70Ypeursfxrow2QgO2ho0brFGICG9ZTWCeXFY6U2crkEiv4rFum wNN4nFCMhWUS+CrzfETO7RzthpRojtDk5C7XeqzQHKtzVRMeUCDgi4CrMO07DpmunO 75Nvu66OTIEptg/bx2VehZ6pdb7Vv/xIbG17BsgQ= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron , Miquel Raynal , Philippe Reynes Subject: [PATCH 06/23] iio:adc:max1027: drop of_match_ptr and CONFIG_OF protections Date: Sun, 28 Jun 2020 13:36:37 +0100 Message-Id: <20200628123654.32830-7-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 just prevent the driver being used with ACPI PRP0001 and provide no major benefits. Part of clearing these out in general in IIO to avoid cut and paste repetition in new drivers. Also include mod_devicetable.h as we directly make use of of_device_id which is defined in there. Signed-off-by: Jonathan Cameron Cc: Miquel Raynal Cc: Philippe Reynes --- drivers/iio/adc/max1027.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c index 9e993ccd14de..ca1dff3924ff 100644 --- a/drivers/iio/adc/max1027.c +++ b/drivers/iio/adc/max1027.c @@ -14,6 +14,7 @@ #include #include +#include #include #include @@ -79,7 +80,6 @@ static const struct spi_device_id max1027_id[] = { }; MODULE_DEVICE_TABLE(spi, max1027_id); -#ifdef CONFIG_OF static const struct of_device_id max1027_adc_dt_ids[] = { { .compatible = "maxim,max1027" }, { .compatible = "maxim,max1029" }, @@ -90,7 +90,6 @@ static const struct of_device_id max1027_adc_dt_ids[] = { {}, }; MODULE_DEVICE_TABLE(of, max1027_adc_dt_ids); -#endif #define MAX1027_V_CHAN(index, depth) \ { \ @@ -518,7 +517,7 @@ static int max1027_probe(struct spi_device *spi) static struct spi_driver max1027_driver = { .driver = { .name = "max1027", - .of_match_table = of_match_ptr(max1027_adc_dt_ids), + .of_match_table = max1027_adc_dt_ids, }, .probe = max1027_probe, .id_table = max1027_id, From patchwork Sun Jun 28 12:36:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11630103 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 77D5F13B4 for ; Sun, 28 Jun 2020 12:39:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 513B920760 for ; Sun, 28 Jun 2020 12:39:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347950; bh=+8G+QHlUj4poyC0//Qc8XHw0PA41JydyQgUI33cR0hg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mScJRBZDHJHly1Hvw7vjz1GI77WiG5/IHa2LqQ/a/qOKfD3ZnrhJocapgttawGdA+ LV0uPa1K1ro5pEMmqfS/lmaSZYutJeOnCl55Av4dg9OjJrUZKkEJdtkp8pDzo1avAl NoLT9rvyTCL8mWZxYc8aDqmM+L2TCX+sZJD/6ITo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726556AbgF1MjJ (ORCPT ); Sun, 28 Jun 2020 08:39:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:53136 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726373AbgF1MjJ (ORCPT ); Sun, 28 Jun 2020 08:39:09 -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 7279420885; Sun, 28 Jun 2020 12:39:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347949; bh=+8G+QHlUj4poyC0//Qc8XHw0PA41JydyQgUI33cR0hg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X44Cco6crdT1NZ9SuHDVkLel0xXHzj88z97wJdUD33X4UTNqNXzfTaCZDim/tHqZy 29HQq6dLP1QhoEArgg3n8kiavBxYF7AhJeKeHOhuhyCetfgpwGMEsKJXeFcHZTU2CJ mxuLtxwCjJFtVOs+3Fea1nf0zXRgF1P/lU39OCxk= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= Subject: [PATCH 07/23] iio:adc:ltc2496: Drop of_match_ptr and use mod_devicetable.h Date: Sun, 28 Jun 2020 13:36:38 +0100 Message-Id: <20200628123654.32830-8-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 The macro prevents use of driver with ACPI PRP0001 and the of_match_id structure is defined in mod_devicetable.h so include that directly rather than of.h. Note this is mostly about removing something I don't want cut and paste into new drivers rather than expectation that this particular driver will be used on an ACPI platform. Signed-off-by: Jonathan Cameron Cc: Uwe Kleine-König Reviewed-by: Uwe Kleine-König --- drivers/iio/adc/ltc2496.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ltc2496.c b/drivers/iio/adc/ltc2496.c index 88a30156a849..dd956a7c216e 100644 --- a/drivers/iio/adc/ltc2496.c +++ b/drivers/iio/adc/ltc2496.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include "ltc2497.h" @@ -96,7 +96,7 @@ MODULE_DEVICE_TABLE(of, ltc2496_of_match); static struct spi_driver ltc2496_driver = { .driver = { .name = "ltc2496", - .of_match_table = of_match_ptr(ltc2496_of_match), + .of_match_table = ltc2496_of_match, }, .probe = ltc2496_probe, .remove = ltc2496_remove, From patchwork Sun Jun 28 12:36: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: 11630105 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 4092413B4 for ; Sun, 28 Jun 2020 12:39:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 26357208B6 for ; Sun, 28 Jun 2020 12:39:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347952; bh=0Kep5vf3LddS9GzYz5onH9z2/GwPK0upcNcDCnoRMJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=bcxXxwTWGLMEh/r49oPSsKopRbHJr3721ApV4hHXTbAvo5wbAaoQ5G8OZrvTYjvls UFEcrgEHY7x08PlFIxPwYRLj+QNeQ6xiUhSbXLLGeDt7ka67jT2F2mnYi9rdqW1jm7 Jssky2WoSA5h1ctoDuWMYKBjqytcYVktYYoO6u8A= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726557AbgF1MjL (ORCPT ); Sun, 28 Jun 2020 08:39:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:53154 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726373AbgF1MjL (ORCPT ); Sun, 28 Jun 2020 08:39: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 DAFD520738; Sun, 28 Jun 2020 12:39:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347950; bh=0Kep5vf3LddS9GzYz5onH9z2/GwPK0upcNcDCnoRMJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rXQ2Z2dTq3YvzTGGLB2iKTbn56v/VurY1cHGom4vW3nhTGj41TmbbOa9VBX8eadns 9Iv8vCS8TgZ5OmOifUvmNtCml+K1A1hb1VhDtuEZvSY0KM1Wh1rA2GCna7rBPdEKpM tjXQVBo6j4LnOAH3E1JGpltfp4oi90p10tl0dKdk= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron , Tony Lindgren Subject: [PATCH 08/23] iio:adc:cpcap-adc: Drop of_match_ptr protection and use device_get_match_data Date: Sun, 28 Jun 2020 13:36:39 +0100 Message-Id: <20200628123654.32830-9-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 Part of a slow effort to avoid OF specific code in IIO. Whilst the main advantages of this are not likely to be seen in this particular driver (ACPI support via PRP0001) the change proposed does make things a bit more maintainable and also ensures that this particular (now) anti-patern is less likely to be cut and paste into new drivers. Signed-off-by: Jonathan Cameron Cc: Tony Lindgren Acked-by: Tony Lindgren --- drivers/iio/adc/cpcap-adc.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/iio/adc/cpcap-adc.c b/drivers/iio/adc/cpcap-adc.c index 004e7fee1fb2..cc26cf309638 100644 --- a/drivers/iio/adc/cpcap-adc.c +++ b/drivers/iio/adc/cpcap-adc.c @@ -15,9 +15,9 @@ #include #include #include -#include -#include +#include #include +#include #include #include @@ -955,22 +955,10 @@ MODULE_DEVICE_TABLE(of, cpcap_adc_id_table); static int cpcap_adc_probe(struct platform_device *pdev) { - const struct of_device_id *match; struct cpcap_adc *ddata; struct iio_dev *indio_dev; int error; - match = of_match_device(of_match_ptr(cpcap_adc_id_table), - &pdev->dev); - if (!match) - return -EINVAL; - - if (!match->data) { - dev_err(&pdev->dev, "no configuration data found\n"); - - return -ENODEV; - } - indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*ddata)); if (!indio_dev) { dev_err(&pdev->dev, "failed to allocate iio device\n"); @@ -978,7 +966,9 @@ static int cpcap_adc_probe(struct platform_device *pdev) return -ENOMEM; } ddata = iio_priv(indio_dev); - ddata->ato = match->data; + ddata->ato = device_get_match_data(&pdev->dev); + if (!ddata->ato) + return -ENODEV; ddata->dev = &pdev->dev; mutex_init(&ddata->lock); @@ -1027,7 +1017,7 @@ static int cpcap_adc_probe(struct platform_device *pdev) static struct platform_driver cpcap_adc_driver = { .driver = { .name = "cpcap_adc", - .of_match_table = of_match_ptr(cpcap_adc_id_table), + .of_match_table = cpcap_adc_id_table, }, .probe = cpcap_adc_probe, }; From patchwork Sun Jun 28 12:36:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11630107 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 7775114B7 for ; Sun, 28 Jun 2020 12:39:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5559C208B6 for ; Sun, 28 Jun 2020 12:39:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347954; bh=zI3RehXVf5DLbGbpuhmOMehOJYaTZfggTCm5mLkHvpw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=t+pA0TndC3KnTjuoD6uq3f689kuKn+cHyEQ7u/2OxsZXyHzrobaFYSdbsDSTaOwBf v2iH8AtpUskTAjMnlowdtF5rm524SF28Kp8sVQv6CvwrPfPdoCAdG+6kCFZvzUZbwY yZbfYw/df8PsDToF8tipzAvb9xmOgt0FnRKsLolY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726447AbgF1MjM (ORCPT ); Sun, 28 Jun 2020 08:39:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:53168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726373AbgF1MjM (ORCPT ); Sun, 28 Jun 2020 08:39:12 -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 47DF520760; Sun, 28 Jun 2020 12:39:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347952; bh=zI3RehXVf5DLbGbpuhmOMehOJYaTZfggTCm5mLkHvpw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RYw9lZjvTimY5SWM8R4zQBbf8353n/v4Z0fklFISbviHhtjtTPq8BJltZXzJsoMrb bQ2Anl1SNU2NZU+tvhkt0+qX1/vlmj7M4P6y+NJSysDljgyyLUVk0gETwAw7F9ipec VOhLXfnMRn0FTPrQz8kMUhDQ1QLUkGe8fJrcHE/Y= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron , Michael Hennerich , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= Subject: [PATCH 09/23] iio:adc:ltc2497 drop of_match_ptr protection Date: Sun, 28 Jun 2020 13:36:40 +0100 Message-Id: <20200628123654.32830-10-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 the driver being used with ACPI PRP0001 based bindings. Also switch include to mod_devicetable.h which devices the used id structure. Note this is most about removing something I don't want want cut and paste into new driver rather than any thought that this particular driver will be used in an ACPI system (though it might!) Signed-off-by: Jonathan Cameron Cc: Michael Hennerich Cc: Uwe Kleine-König Reviewed-by: Uwe Kleine-König --- drivers/iio/adc/ltc2497.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ltc2497.c b/drivers/iio/adc/ltc2497.c index 5db63d7c6bc5..1adddf5a88a9 100644 --- a/drivers/iio/adc/ltc2497.c +++ b/drivers/iio/adc/ltc2497.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include "ltc2497.h" @@ -98,7 +98,7 @@ MODULE_DEVICE_TABLE(of, ltc2497_of_match); static struct i2c_driver ltc2497_driver = { .driver = { .name = "ltc2497", - .of_match_table = of_match_ptr(ltc2497_of_match), + .of_match_table = ltc2497_of_match, }, .probe = ltc2497_probe, .remove = ltc2497_remove, From patchwork Sun Jun 28 12:36: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: 11630109 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 DA36D13B4 for ; Sun, 28 Jun 2020 12:39:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B8F0C208B6 for ; Sun, 28 Jun 2020 12:39:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347955; bh=HOOSFXk00b0q4slNXO37TWA5HPxLOWzPQxswS+rW7T4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mfpnEowp6dIat1vZla5bIybssntAnmeO9gCFByGkQqYV/iUE7/lmqUy2qJ8pqEW7j NEJb6tqVAD4MfgXxLUWTzHoVxNdZFq98VydLFrQPtIwsT5bQPTqdFUPG7GEXFQUVSw A6XFHjMECduP046MurZdspGD0ufwLLlz3+5sPSK4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726479AbgF1MjP (ORCPT ); Sun, 28 Jun 2020 08:39:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:53186 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726373AbgF1MjN (ORCPT ); Sun, 28 Jun 2020 08:39: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 CD29D2076E; Sun, 28 Jun 2020 12:39:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347953; bh=HOOSFXk00b0q4slNXO37TWA5HPxLOWzPQxswS+rW7T4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bT5KhxXsKyOqRB1gWPSCde1j1kkwU69jbRHdahOnhBu26mY5FCtCl3ixx6gCqCUqt Q3wMR4aYaJQq2stwsJf/TGG7p71ULMBjE+9m0leoJ68dWI3tsvdy0wevuTARlEfGpn Dj6T+NKuKgGR0NSIyVRtwQ0476ViZzUFc2+GDEys= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron , Jacopo Mondi Subject: [PATCH 10/23] iio:adc:max11100: Drop of_match_ptr protection / add mod_devicetable.h include Date: Sun, 28 Jun 2020 13:36:41 +0100 Message-Id: <20200628123654.32830-11-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 Allows use of driver with ACPI PRP0001 base binding. Mostly this is about trying to avoid cut and paste of this into new drivers (it is a frequent review comment) rather than any thought that this driver might get used on an ACPI platform. The mod_devicetable.h include is to encourage best practice of including any header directly used within the code (here for of_match_id) Signed-off-by: Jonathan Cameron Cc: Jacopo Mondi Acked-by: Jacopo Mondi --- drivers/iio/adc/max11100.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/max11100.c b/drivers/iio/adc/max11100.c index 57734f9742f6..77fcee1dddf7 100644 --- a/drivers/iio/adc/max11100.c +++ b/drivers/iio/adc/max11100.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -161,7 +162,7 @@ MODULE_DEVICE_TABLE(of, max11100_ids); static struct spi_driver max11100_driver = { .driver = { .name = "max11100", - .of_match_table = of_match_ptr(max11100_ids), + .of_match_table = max11100_ids, }, .probe = max11100_probe, .remove = max11100_remove, From patchwork Sun Jun 28 12:36: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: 11630111 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 5FA47174A for ; Sun, 28 Jun 2020 12:39:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3F6E9208B6 for ; Sun, 28 Jun 2020 12:39:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347956; bh=23Rs0c4y4scQtvDfQVwU0AjBUAD6Tw+9G2uyv8LsWz4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=w76P7WcsEMj/YjxVkzHSdXlMB40UMFZIvxWb4mDEpjJ8C7vBApjuDNxxU/p2LZtA6 HhldtYjdZuQQrSzD404Q6Ze8vo3dpI8Q0S/D22pzOGoK7sm0stZGFmr4XFJylPfb5G 7Y8B2Nt+pPVd6b4UWK2v8wXVMSNWXQMJiWpLhJIk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726373AbgF1MjP (ORCPT ); Sun, 28 Jun 2020 08:39:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:53200 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726559AbgF1MjP (ORCPT ); Sun, 28 Jun 2020 08:39: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 3BAE920738; Sun, 28 Jun 2020 12:39:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347955; bh=23Rs0c4y4scQtvDfQVwU0AjBUAD6Tw+9G2uyv8LsWz4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xuIhlK3Y7vDzy1Ya9kRhSr0nq0m5kWCi9pKeCyJtMdWcMY1qQ6zgeCXZ+yKJq3gnj MQwrYQdXIjzAKAKdlNarqsUMOmQdqnz3RqUk/q2cdU4vYQrKxzfZ9Slxn+we6pZdjp SuMmim3r/TI2jNSZL4vCdUtm8SRMxxGbU6qGS/7c= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron , Akinobu Mita Subject: [PATCH 11/23] iio:adc:max1118: Drop CONFIG_OF / of_match_ptr protections Date: Sun, 28 Jun 2020 13:36:42 +0100 Message-Id: <20200628123654.32830-12-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 just stop the driver being used with ACPI PRP0001 and we are trying to clear them out of IIO to avoid them getting copied into new drivers. Also add the mod_devicetable.h include as we are using struct of_device_id which is defined in there. Signed-off-by: Jonathan Cameron Cc: Akinobu Mita --- drivers/iio/adc/max1118.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/iio/adc/max1118.c b/drivers/iio/adc/max1118.c index 273fbea2a515..01b20e420ac4 100644 --- a/drivers/iio/adc/max1118.c +++ b/drivers/iio/adc/max1118.c @@ -18,6 +18,7 @@ */ #include +#include #include #include #include @@ -280,8 +281,6 @@ static const struct spi_device_id max1118_id[] = { }; MODULE_DEVICE_TABLE(spi, max1118_id); -#ifdef CONFIG_OF - static const struct of_device_id max1118_dt_ids[] = { { .compatible = "maxim,max1117" }, { .compatible = "maxim,max1118" }, @@ -290,12 +289,10 @@ static const struct of_device_id max1118_dt_ids[] = { }; MODULE_DEVICE_TABLE(of, max1118_dt_ids); -#endif - static struct spi_driver max1118_spi_driver = { .driver = { .name = "max1118", - .of_match_table = of_match_ptr(max1118_dt_ids), + .of_match_table = max1118_dt_ids, }, .probe = max1118_probe, .remove = max1118_remove, From patchwork Sun Jun 28 12:36:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11630113 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 96CE714B7 for ; Sun, 28 Jun 2020 12:39:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 75CFB20885 for ; Sun, 28 Jun 2020 12:39:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347958; bh=Y4ykPCu/uFg/Mwr3Xw7IJJOphupiq1C7mA3+puk7UdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=T8uzXS2NAWZS1GznNVzdcWSbj+ylFx4A7mwf9FoLNCUlHQ+YEg501MFXytRRhc8mT LA/qn5/m+o7F4ELYKiekZNOCjvjsUDM2wbgpXUcz+NV9CW1N3ycqUWELqvqzCQUqYL 13cpk0vBs8Dr9e6rsvXwqvONx2/tOMzWleFjgZbE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726562AbgF1MjR (ORCPT ); Sun, 28 Jun 2020 08:39:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:53216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726559AbgF1MjR (ORCPT ); Sun, 28 Jun 2020 08:39:17 -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 97FA620760; Sun, 28 Jun 2020 12:39:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347956; bh=Y4ykPCu/uFg/Mwr3Xw7IJJOphupiq1C7mA3+puk7UdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bUqse5yEnkYvYipGSQz3s4vOzinhAuBxirzwdbTfssdudeniGqvMTQYOS57gICBKg 85IwfTTRImDy75DHqXWfemz/GkyQ0LP+N2YmR3tzADoerOQukbAFQwK0PNSiQudFPi Z5IymuPiW5DtbDa5yDyWgFqjmMmOyBSz1QjGPh0Q= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron , Oskar Andero , =?utf-8?q?S=C3=B8ren_Andersen?= , Lukas Wunner Subject: [PATCH 12/23] iio:adc:mcp320x: Drop CONFIG_OF and of_match_ptr protections Date: Sun, 28 Jun 2020 13:36:43 +0100 Message-Id: <20200628123654.32830-13-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 just prevent the driver being used with ACPI PRP0001. They also get cut and paste into new drivers and we want to discourage this from happening by cleaning it out in general. Signed-off-by: Jonathan Cameron Cc: Oskar Andero Cc: Søren Andersen Cc: Lukas Wunner --- drivers/iio/adc/mcp320x.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/mcp320x.c b/drivers/iio/adc/mcp320x.c index e533f1064cf8..bb37e66ff7dc 100644 --- a/drivers/iio/adc/mcp320x.c +++ b/drivers/iio/adc/mcp320x.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -469,7 +470,6 @@ static int mcp320x_remove(struct spi_device *spi) return 0; } -#if defined(CONFIG_OF) static const struct of_device_id mcp320x_dt_ids[] = { /* NOTE: The use of compatibles with no vendor prefix is deprecated. */ { .compatible = "mcp3001" }, @@ -497,7 +497,6 @@ static const struct of_device_id mcp320x_dt_ids[] = { { } }; MODULE_DEVICE_TABLE(of, mcp320x_dt_ids); -#endif static const struct spi_device_id mcp320x_id[] = { { "mcp3001", mcp3001 }, @@ -520,7 +519,7 @@ MODULE_DEVICE_TABLE(spi, mcp320x_id); static struct spi_driver mcp320x_driver = { .driver = { .name = "mcp320x", - .of_match_table = of_match_ptr(mcp320x_dt_ids), + .of_match_table = mcp320x_dt_ids, }, .probe = mcp320x_probe, .remove = mcp320x_remove, From patchwork Sun Jun 28 12:36:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11630115 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 7744D13B4 for ; Sun, 28 Jun 2020 12:39:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 55D35208B6 for ; Sun, 28 Jun 2020 12:39:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347959; bh=+x/8ZKYoENY4A9z32X4I3gXxTtDbpzgabpqW4LhGGrA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=fnX9IGCHPiOOdjA6DIiDUb4RwDGy+WvucRaSuBidXCvjcV+bFu7LffDNq/qh7/i4n Y0bvCT1e9E8BOQAyFIvMHsJAvBrO1SEBIKVdOX2NCJJpe3yWTcpsEOXAgN4IS/J+T4 o/wBcUGNm9rS9RBOvdug1E4bP/5tWZSm7vJZe3D4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726563AbgF1MjS (ORCPT ); Sun, 28 Jun 2020 08:39:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:53228 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726559AbgF1MjS (ORCPT ); Sun, 28 Jun 2020 08:39:18 -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 54AA42076E; Sun, 28 Jun 2020 12:39:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347958; bh=+x/8ZKYoENY4A9z32X4I3gXxTtDbpzgabpqW4LhGGrA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gLpZXCXBGIUStYWD+Gbm42s0UrnEbA7nhlvIROo5LW2RVjrRg0/9qoTtvjB0aVKne 1vEFHIbdhitN0UUKc1vK6roikpgifM1gOvBiRtnW3uyE7/+XtgzvDdCyD3SzRIDgyk QkODtBQkNV9J+UrwSPd+OzzQwpXaeEBf1sF67dk8= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron , Angelo Compagnucci Subject: [PATCH 13/23] iio:adc:mcp3422: remove CONFIG_OF and of_match_ptr protections Date: Sun, 28 Jun 2020 13:36:44 +0100 Message-Id: <20200628123654.32830-14-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 They stop the driver being used with ACPI PRP0001 and are something I want to avoid being cut and paste into new drivers. Also switch the include from of.h to mod_devicetable.h as we struct of_device_id is defined in there and we don't use anything actually in of.h. Signed-off-by: Jonathan Cameron Cc: Angelo Compagnucci --- drivers/iio/adc/mcp3422.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iio/adc/mcp3422.c b/drivers/iio/adc/mcp3422.c index 40e0d3ed05a5..ec9c79199ffb 100644 --- a/drivers/iio/adc/mcp3422.c +++ b/drivers/iio/adc/mcp3422.c @@ -16,9 +16,9 @@ #include #include #include +#include #include #include -#include #include #include @@ -402,18 +402,16 @@ static const struct i2c_device_id mcp3422_id[] = { }; MODULE_DEVICE_TABLE(i2c, mcp3422_id); -#ifdef CONFIG_OF static const struct of_device_id mcp3422_of_match[] = { { .compatible = "mcp3422" }, { } }; MODULE_DEVICE_TABLE(of, mcp3422_of_match); -#endif static struct i2c_driver mcp3422_driver = { .driver = { .name = "mcp3422", - .of_match_table = of_match_ptr(mcp3422_of_match), + .of_match_table = mcp3422_of_match, }, .probe = mcp3422_probe, .id_table = mcp3422_id, From patchwork Sun Jun 28 12:36:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11630117 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 F06C313B4 for ; Sun, 28 Jun 2020 12:39:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CEEA3208C7 for ; Sun, 28 Jun 2020 12:39:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347960; bh=S1hmZJVxqLKT2wWmJdk3O13MSrEdDy7XW3sSEJzPfOw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=cDO/cL9stcW1gz2jAh5pEoStTan3oPsYB3ti8GNAreraYdsGgi3UrzaCPfs+jAHAJ U86zBPSCdj5P2X+rp+bKPDwQkpRuP7G7Eme5udkuXYiYxeFXdpqCaWN2jPTBxnoxsL vm8jx8NgZjtiFXRC6X0y9MUdEJtKjnb78ZL1TON8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726564AbgF1MjU (ORCPT ); Sun, 28 Jun 2020 08:39:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:53244 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726559AbgF1MjT (ORCPT ); Sun, 28 Jun 2020 08:39:19 -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 C606020738; Sun, 28 Jun 2020 12:39:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347959; bh=S1hmZJVxqLKT2wWmJdk3O13MSrEdDy7XW3sSEJzPfOw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MJVr79UvhhfZhreQOPMsB2+XmU1WRP+cHFxqQQHrjQWdEWsasEKP6YylveoKZXsS8 GcKvuL2lIep4kzbVec05QmwJk94qtCkMqO/RXBmfowSfCbw3vKs1kVrSbJ+8drzYUL l7wWt0QSHnb48EM7Gd/npMw6jmSTv3eWeuv6zNn8= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron , Arnaud Pouliquen Subject: [PATCH 14/23] iio:adc:sd_adc_modulator: Drop of_match_ptr and tweak includes Date: Sun, 28 Jun 2020 13:36:45 +0100 Message-Id: <20200628123654.32830-15-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 Dropping of_match_ptr allows this driver to be used with ACPI. The header includes are adjusted to include platform_device.h and mod_devicetable.h instead of OF specific header as nothing from that header itself is actually used. Signed-off-by: Jonathan Cameron Cc: Arnaud Pouliquen --- drivers/iio/adc/sd_adc_modulator.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/sd_adc_modulator.c b/drivers/iio/adc/sd_adc_modulator.c index 1d6c246609c8..327cc2097f6c 100644 --- a/drivers/iio/adc/sd_adc_modulator.c +++ b/drivers/iio/adc/sd_adc_modulator.c @@ -9,7 +9,8 @@ #include #include #include -#include +#include +#include static const struct iio_info iio_sd_mod_iio_info; @@ -54,7 +55,7 @@ MODULE_DEVICE_TABLE(of, sd_adc_of_match); static struct platform_driver iio_sd_mod_adc = { .driver = { .name = "iio_sd_adc_mod", - .of_match_table = of_match_ptr(sd_adc_of_match), + .of_match_table = sd_adc_of_match, }, .probe = iio_sd_mod_probe, }; From patchwork Sun Jun 28 12:36:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11630119 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 631B413B4 for ; Sun, 28 Jun 2020 12:39:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 423DD208C7 for ; Sun, 28 Jun 2020 12:39:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347962; bh=tRtoUybSIIMd0kLcDWQzRSez9/8h6H7KMA45oHMvKyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Ay+dg5vfkypQxox7ukEWXzl6pqR8yk+oVBxQJQh/J61IWJGTs0h0lmads15ONvVya kkz+osBm1IDEOG+brcprWvl+bZbMSu9O+8cUxvZ+xmvVRdA8YykH5kHA7/COSWaTa/ Z9PBXOwih3XymLlyPghbMR30kl9qXE1Y9nHhSNDM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726566AbgF1MjV (ORCPT ); Sun, 28 Jun 2020 08:39:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:53260 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726559AbgF1MjV (ORCPT ); Sun, 28 Jun 2020 08:39:21 -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 376ED20885; Sun, 28 Jun 2020 12:39:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347961; bh=tRtoUybSIIMd0kLcDWQzRSez9/8h6H7KMA45oHMvKyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wD+u2v5Xu6G5/ZSlviCyChNN+cDwSNHMF0hO/XOiCSsfnkyjKJAqJCO5XEL7KOCcT iYe1fARMk3EfNcQNTViSvlhACNEaEIUaQ3uxAdkvGB8kG30Ag49ptgazEffN7pds7s GPSpgNrvsdDYZTL+qA2FiiMYjIKfpTvJu5dMXhcM= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron Subject: [PATCH 15/23] iio:adc:ti-adc081c: Drop of_match_ptr and change to mod_devicetable.h Date: Sun, 28 Jun 2020 13:36:46 +0100 Message-Id: <20200628123654.32830-16-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 Whilst this driver already supports explicit ACPI bindings we might as well also allow for PRP0001 based binding. I'm also keen to remove of_match_ptr from IIO drivers to avoid this (now) anti-pattern getting coppied into new drivers. Signed-off-by: Jonathan Cameron --- drivers/iio/adc/ti-adc081c.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iio/adc/ti-adc081c.c b/drivers/iio/adc/ti-adc081c.c index 82e524b3db88..e00350e6503f 100644 --- a/drivers/iio/adc/ti-adc081c.c +++ b/drivers/iio/adc/ti-adc081c.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include @@ -230,7 +230,6 @@ static const struct i2c_device_id adc081c_id[] = { }; MODULE_DEVICE_TABLE(i2c, adc081c_id); -#ifdef CONFIG_OF static const struct of_device_id adc081c_of_match[] = { { .compatible = "ti,adc081c" }, { .compatible = "ti,adc101c" }, @@ -238,7 +237,6 @@ static const struct of_device_id adc081c_of_match[] = { { } }; MODULE_DEVICE_TABLE(of, adc081c_of_match); -#endif #ifdef CONFIG_ACPI static const struct acpi_device_id adc081c_acpi_match[] = { @@ -253,7 +251,7 @@ MODULE_DEVICE_TABLE(acpi, adc081c_acpi_match); static struct i2c_driver adc081c_driver = { .driver = { .name = "adc081c", - .of_match_table = of_match_ptr(adc081c_of_match), + .of_match_table = adc081c_of_match, .acpi_match_table = ACPI_PTR(adc081c_acpi_match), }, .probe = adc081c_probe, From patchwork Sun Jun 28 12:36:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11630121 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 34E8C14B7 for ; Sun, 28 Jun 2020 12:39:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 13EC720885 for ; Sun, 28 Jun 2020 12:39:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347964; bh=q1EvbuzQoy5OKP0mE0v4r5NANIrUtq18Zv+nJ4pvmTI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Ax7nB5ODD+4pWYYl8Cfnb7cHGNWkCpEeY8LC4Qwc5UbJQgq4b+O8WN/S9FJxqaPTq WIiXwK3zfFg5OLO3mnvPYlzBYFULrXEBIB9tR7eopHz6VEeTzc3q96IjJyVZFrr271 KOkjt1CNCtYYYKMw+3r6vuQMROKd1ShntHi1Sid8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726559AbgF1MjX (ORCPT ); Sun, 28 Jun 2020 08:39:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:53274 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726459AbgF1MjW (ORCPT ); Sun, 28 Jun 2020 08:39:22 -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 6ECE52076E; Sun, 28 Jun 2020 12:39:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347962; bh=q1EvbuzQoy5OKP0mE0v4r5NANIrUtq18Zv+nJ4pvmTI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CvyX8YZqz+PXYbkHVGiFvfzEjRcVwdzoszKooBVMbnXonjbtNMyC4yfvkM7/b8iGZ nyGQBGu2wbzIkcAuh+NV3Bna1zd4nENSDwNl//kv6CyCuHbLAXgPbtbQNAL1FTYRoe Rk1o+ujc1UKPgCBXViHAiWOTN7+vi6sxvFUAzsi4= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron , Akinobu Mita Subject: [PATCH 16/23] iio:adc:ti-adc0832: drop CONFIG_OF and of_match_ptr protections Date: Sun, 28 Jun 2020 13:36:47 +0100 Message-Id: <20200628123654.32830-17-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 just prevent the driver being used with ACPI PRP0001. I am also trying to remove these from IIO in general to avoid them being coppied into new drivers. Also include the mod_devicetable.h header as we are using of_device_id which is defined in there. Signed-off-by: Jonathan Cameron Cc: Akinobu Mita --- drivers/iio/adc/ti-adc0832.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/iio/adc/ti-adc0832.c b/drivers/iio/adc/ti-adc0832.c index 3eb3ba5fb610..05061dc05b32 100644 --- a/drivers/iio/adc/ti-adc0832.c +++ b/drivers/iio/adc/ti-adc0832.c @@ -8,6 +8,7 @@ */ #include +#include #include #include #include @@ -313,8 +314,6 @@ static int adc0832_remove(struct spi_device *spi) return 0; } -#ifdef CONFIG_OF - static const struct of_device_id adc0832_dt_ids[] = { { .compatible = "ti,adc0831", }, { .compatible = "ti,adc0832", }, @@ -324,8 +323,6 @@ static const struct of_device_id adc0832_dt_ids[] = { }; MODULE_DEVICE_TABLE(of, adc0832_dt_ids); -#endif - static const struct spi_device_id adc0832_id[] = { { "adc0831", adc0831 }, { "adc0832", adc0832 }, @@ -338,7 +335,7 @@ MODULE_DEVICE_TABLE(spi, adc0832_id); static struct spi_driver adc0832_driver = { .driver = { .name = "adc0832", - .of_match_table = of_match_ptr(adc0832_dt_ids), + .of_match_table = adc0832_dt_ids, }, .probe = adc0832_probe, .remove = adc0832_remove, From patchwork Sun Jun 28 12:36:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11630123 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 4E02A14B7 for ; Sun, 28 Jun 2020 12:39:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2D2C920738 for ; Sun, 28 Jun 2020 12:39:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347965; bh=9ohi+nrNv/8GK3r1qJC3YAtMoWzP9JYvhmJTZx9Ay04=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=cre6NhlnhCSu+2EDnMrBnd0ajTkstED4aUqL2PyP9+UINzUdOvTILDmJRuQfHq8Ls DVBnUKvP/PhoSFAW8KfH44DcsbcE9xu3clbpoztz/I98fPT2rdSndiHxz9qZ8yajzZ bSOwsVhJxqIYMDAtME4HB5oJe24w92f/ZR5CbRic= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726411AbgF1MjY (ORCPT ); Sun, 28 Jun 2020 08:39:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:53288 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726459AbgF1MjX (ORCPT ); Sun, 28 Jun 2020 08:39: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 CF47E208B6; Sun, 28 Jun 2020 12:39:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347963; bh=9ohi+nrNv/8GK3r1qJC3YAtMoWzP9JYvhmJTZx9Ay04=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v86r2i0UGNlEUSalwXXx7+o8iLO5DSKoiKwE/B6pvHnv1/cIWOkCApoG66sSRdcaX Rrm5MuFysu5xL8WJIUm3WuIfLBF4vhbWXpg5pJ40TeRaJkhCHZf5oKhdichZFhWvdQ y0aov3F7AOl3T64TVzRPCK0jm/CvT0NOY5W+tC3g= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron , =?utf-8?q?M=C3=A5rten_Linda?= =?utf-8?q?hl?= Subject: [PATCH 17/23] iio:adc:ti-adc084s021: drop of_match_ptr protection Date: Sun, 28 Jun 2020 13:36:48 +0100 Message-Id: <20200628123654.32830-18-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 Allows ACPI PRP0001 to be used with this driver. Also adds mod_devicetable.h header as the driver is directly using struct of_device_id which is defined in that file. I'm also trying to clear out of_match_ptr use in IIO to avoid it being cut and paste into new drivers. Signed-off-by: Jonathan Cameron Cc: Mårten Lindahl --- drivers/iio/adc/ti-adc084s021.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/ti-adc084s021.c b/drivers/iio/adc/ti-adc084s021.c index c2db2435f419..5678bf7499b1 100644 --- a/drivers/iio/adc/ti-adc084s021.c +++ b/drivers/iio/adc/ti-adc084s021.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -254,7 +255,7 @@ MODULE_DEVICE_TABLE(spi, adc084s021_id); static struct spi_driver adc084s021_driver = { .driver = { .name = ADC084S021_DRIVER_NAME, - .of_match_table = of_match_ptr(adc084s021_of_match), + .of_match_table = adc084s021_of_match, }, .probe = adc084s021_probe, .id_table = adc084s021_id, From patchwork Sun Jun 28 12:36:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11630125 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 8714713B4 for ; Sun, 28 Jun 2020 12:39:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6ECF62076E for ; Sun, 28 Jun 2020 12:39:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347966; bh=iqOiNR5aBrgv2ybIysFrgMlk25L22Abrh9ZIVftrjWM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=GMM2TzB7iPsb/vrYg+3hoTACX05KTEDbqBwMwQubpD/A8K6abb/JWIORpO/cbNy/4 CgXZ/QxsTBpxKvBy/3lH6d87BQMgzpq9OD34QbvYW/A31S/XmCu5aZocHI840UYOvO 500tg/vWkKqbIvbwFJUC0Sb5Lx6z6u4vMbj3SmSE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726485AbgF1MjZ (ORCPT ); Sun, 28 Jun 2020 08:39:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:53308 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726459AbgF1MjZ (ORCPT ); Sun, 28 Jun 2020 08:39:25 -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 3BBFB208C7; Sun, 28 Jun 2020 12:39:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347965; bh=iqOiNR5aBrgv2ybIysFrgMlk25L22Abrh9ZIVftrjWM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rOsj/q35UQJZ0mA5KBrf1vgYvSq5hpQmeALTEe7QS7glr8oyhZW5xyiFCUHhqo3gu B3GuAjxExRhrh07sQxrzXK2HtavUPlR8LZ6DSMMVs4LdQKbdHvAbrY4mcxsJ9Pccu8 murILrXmkVwwi0vnN8Q6n74qgAAvb+WHnNckoId4= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron , Jan Kiszka Subject: [PATCH 18/23] iio:adc:ti-adc108s102: Drop CONFIG_OF and of_match_ptr protections Date: Sun, 28 Jun 2020 13:36:49 +0100 Message-Id: <20200628123654.32830-19-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 Although this driver has an explicit ACPI binding it is good to also allow for PRP0001 use of the of_match_id table. I'm also trying to clean this (now) anti-pattern out of IIO to avoid cut and paste into new drivers. Also add an include of mod_devicetable.h as the driver directly uses struct of_device_id which is defined in there. Signed-off-by: Jonathan Cameron Cc: Jan Kiszka --- drivers/iio/adc/ti-adc108s102.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/ti-adc108s102.c b/drivers/iio/adc/ti-adc108s102.c index 9b9b27415c93..183b2245e89b 100644 --- a/drivers/iio/adc/ti-adc108s102.c +++ b/drivers/iio/adc/ti-adc108s102.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -299,13 +300,11 @@ static int adc108s102_remove(struct spi_device *spi) return 0; } -#ifdef CONFIG_OF static const struct of_device_id adc108s102_of_match[] = { { .compatible = "ti,adc108s102" }, { } }; MODULE_DEVICE_TABLE(of, adc108s102_of_match); -#endif #ifdef CONFIG_ACPI static const struct acpi_device_id adc108s102_acpi_ids[] = { @@ -324,7 +323,7 @@ MODULE_DEVICE_TABLE(spi, adc108s102_id); static struct spi_driver adc108s102_driver = { .driver = { .name = "adc108s102", - .of_match_table = of_match_ptr(adc108s102_of_match), + .of_match_table = adc108s102_of_match, .acpi_match_table = ACPI_PTR(adc108s102_acpi_ids), }, .probe = adc108s102_probe, From patchwork Sun Jun 28 12:36:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11630127 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 9778813B4 for ; Sun, 28 Jun 2020 12:39:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7F5C320B80 for ; Sun, 28 Jun 2020 12:39:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347967; bh=2Vp/HMncT6c0ghGxGu3s2SRLPwjs3iE1JBKBYJZ0a6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=goO46K1SAHtV5zqAaMV8MQaWrIbKTEZy2CQ5aFWHpRU8gpTv1/PJYzIP93TM/vSK+ QcpUI+khn0W9DIN1vN6CUxduMz2XfPNopVixamHe2GhNn5I35vtrHNkIbm6f7E/WLq IcrJlyC3HqaZs+iU8dOpqViwJJomLkzb+SCVEGaw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726506AbgF1Mj0 (ORCPT ); Sun, 28 Jun 2020 08:39:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:53324 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726459AbgF1Mj0 (ORCPT ); Sun, 28 Jun 2020 08:39:26 -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 98B7B20738; Sun, 28 Jun 2020 12:39:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347966; bh=2Vp/HMncT6c0ghGxGu3s2SRLPwjs3iE1JBKBYJZ0a6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U4tg5dL8U1Kxm3pZIpDatKThqfwWpYc0Yg4FS/6FvagIRBhMnf4kMpJ7SU4dTbYJA W+GXov/a/XZkZuwgn0Y05DYD2Xu4bAZlOCaUXIM8TE8cwyHlkAloxZiYIlHVIxLTTh Qbk3oGFrHBCQm/7yb6aeonrjxhneNn+ovpwGkw88= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron , Angelo Compagnucci Subject: [PATCH 19/23] iio:adc:ti-adc128s052: drop of_match_ptr protection Date: Sun, 28 Jun 2020 13:36:50 +0100 Message-Id: <20200628123654.32830-20-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 There is no real advantage in this and it prevents use of ACPI PRP0001. I'm also trying to clear this out of IIO in general to avoid copying in new drivers. Include mod_devicetable.h as we are using of_device_id in here so including that header is best practice. Signed-off-by: Jonathan Cameron Cc: Angelo Compagnucci --- drivers/iio/adc/ti-adc128s052.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s052.c index c1552b0fee04..cc3fb2d1686a 100644 --- a/drivers/iio/adc/ti-adc128s052.c +++ b/drivers/iio/adc/ti-adc128s052.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -220,7 +221,7 @@ MODULE_DEVICE_TABLE(acpi, adc128_acpi_match); static struct spi_driver adc128_driver = { .driver = { .name = "adc128s052", - .of_match_table = of_match_ptr(adc128_of_match), + .of_match_table = adc128_of_match, .acpi_match_table = ACPI_PTR(adc128_acpi_match), }, .probe = adc128_probe, From patchwork Sun Jun 28 12:36:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11630129 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 D7F5C13B4 for ; Sun, 28 Jun 2020 12:39:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF25020B80 for ; Sun, 28 Jun 2020 12:39:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347968; bh=TBEocbTcMd4wHqWwRnZfrUom1/2JaJaBM4nQYPuE+zM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=lmPz+QbZ0xMtuBlYN1v3zDBrnFWwAFkafZV02s5EZVbIHxmnSJlcQBhB06FdLCwdM jQ/j7jY8jW8ZMnVaPQevB/aGeo+AcLeC7054IdWa/jQbo7BDQFKvE8HjB+8mgSisVF MPcKSfMCXsLvBTQfnWcwYqmwDinv/M3nP68UIAn8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726569AbgF1Mj2 (ORCPT ); Sun, 28 Jun 2020 08:39:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:53336 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726567AbgF1Mj2 (ORCPT ); Sun, 28 Jun 2020 08:39: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 073592076E; Sun, 28 Jun 2020 12:39:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347968; bh=TBEocbTcMd4wHqWwRnZfrUom1/2JaJaBM4nQYPuE+zM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vB7XN0K9+l4hSil0Fs5GmxFDRSDJvNyr6qC5htLEe04s69KbJXJVAxRfOnEBg9mB8 sMJdqGUN05YO+ga0SFUb9iWi+AokbYBfgKuYwgEOhv9yU3H1EeSYY+ju75UUb4Ehgt /3T0MBhbtAR8Um8Llt6PUGsfgXoIEtqOjuZBmf4c= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron , Matt Ranostay Subject: [PATCH 20/23] iio:adc:ti-adc161s626: Drop of_match_ptr protection. Date: Sun, 28 Jun 2020 13:36:51 +0100 Message-Id: <20200628123654.32830-21-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 Dropping this allows use of ACPI PRP0001. I'm also looking to drop all of_match_ptr use in IIO in order to avoid it getting cut and paste into new drivers in the future. Also add a direct include of mod_devicetable.h to reflect the use of struct of_device_id. Signed-off-by: Jonathan Cameron Cc: Matt Ranostay Acked-by: Matt Ranostay --- drivers/iio/adc/ti-adc161s626.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/ti-adc161s626.c b/drivers/iio/adc/ti-adc161s626.c index f27ca3161530..607791ffe7f0 100644 --- a/drivers/iio/adc/ti-adc161s626.c +++ b/drivers/iio/adc/ti-adc161s626.c @@ -11,6 +11,7 @@ */ #include +#include #include #include #include @@ -257,7 +258,7 @@ MODULE_DEVICE_TABLE(spi, ti_adc_id); static struct spi_driver ti_adc_driver = { .driver = { .name = TI_ADC_DRV_NAME, - .of_match_table = of_match_ptr(ti_adc_dt_ids), + .of_match_table = ti_adc_dt_ids, }, .probe = ti_adc_probe, .remove = ti_adc_remove, From patchwork Sun Jun 28 12:36:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11630131 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 759DC14B7 for ; Sun, 28 Jun 2020 12:39:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 51EEC208C7 for ; Sun, 28 Jun 2020 12:39:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347970; bh=vwQW7FDmT1YTvO3DuZTf8cH5c6+6KYXMKhSmm5sMUAo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Olsy7NKdp3lHNh7wzNE0th9annmQ2n9I3AYjxiwzMUgVkIjhwW9++gND84SHpIbNK xcq3t1f+XM8WUs+Y8lCuBmE22gtuxUqtjGT6TYUWVk5TXtpA9ksRYsGVLi3ej+DaNZ pV5d5WvmIwN2lwSTfGxELfDjpjjkHW8EmNaXCTw4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726573AbgF1Mj3 (ORCPT ); Sun, 28 Jun 2020 08:39:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:53350 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726567AbgF1Mj3 (ORCPT ); Sun, 28 Jun 2020 08:39: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 6A9B320885; Sun, 28 Jun 2020 12:39:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347969; bh=vwQW7FDmT1YTvO3DuZTf8cH5c6+6KYXMKhSmm5sMUAo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DtF5a68I7QIXvzz1z7EuGu08iW7wADFUt6ISUUj04GdgLp1qQ+iWulz8nNSdASXNJ 6t8rXOEjqnTDBM5Yxi1R3M/5fPwLiSWo3XNHXEexG0Qr90Q10s5wXxI7oSlVX8IcR5 JYV/oEwpYdYZAitUPKy9QtUyMQAA6riGmflCpO2A= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron , Phil Reid Subject: [PATCH 21/23] iio:adc:ti-tlc4541: Drop CONFIG_OF and of_match_ptr protections. Date: Sun, 28 Jun 2020 13:36:52 +0100 Message-Id: <20200628123654.32830-22-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 stop us using ACPI PRP0001 to instantiate the device. I am slowly clearly out use of these in IIO to avoid this being coppied into new drivers. Here I also included mod_devicetable.h as we are using of_match_id which is defined in there and hence it is best practice to include it directly. Signed-off-by: Jonathan Cameron Cc: Phil Reid Reviewed-by: Phil Reid --- drivers/iio/adc/ti-tlc4541.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/ti-tlc4541.c b/drivers/iio/adc/ti-tlc4541.c index 432238246519..53359a2e5bea 100644 --- a/drivers/iio/adc/ti-tlc4541.c +++ b/drivers/iio/adc/ti-tlc4541.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -235,14 +236,12 @@ static int tlc4541_remove(struct spi_device *spi) return 0; } -#ifdef CONFIG_OF static const struct of_device_id tlc4541_dt_ids[] = { { .compatible = "ti,tlc3541", }, { .compatible = "ti,tlc4541", }, {} }; MODULE_DEVICE_TABLE(of, tlc4541_dt_ids); -#endif static const struct spi_device_id tlc4541_id[] = { {"tlc3541", TLC3541}, @@ -254,7 +253,7 @@ MODULE_DEVICE_TABLE(spi, tlc4541_id); static struct spi_driver tlc4541_driver = { .driver = { .name = "tlc4541", - .of_match_table = of_match_ptr(tlc4541_dt_ids), + .of_match_table = tlc4541_dt_ids, }, .probe = tlc4541_probe, .remove = tlc4541_remove, From patchwork Sun Jun 28 12:36:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11630133 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 CDA8F14B7 for ; Sun, 28 Jun 2020 12:39:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AD81C208C7 for ; Sun, 28 Jun 2020 12:39:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347971; bh=9eNDv1CmBLwsXlChrkB+Yomsxb7eXDjKajABk03fLm8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=HSzyKywD3eRJmCTCVzFMhvr70j8W9FXwYnok6CQvDJF4Qk3IkIiahdZ1d9lk3HVkJ sumhJhpfjdkY6D+vvYfn/OUGYpobPeE06x+HGAFfiphZIp9qOcdiExMKChAatFVAFT de4mRLZcersluMuneVWwX0FgkVOFHPxB5O4edvzg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726459AbgF1Mjb (ORCPT ); Sun, 28 Jun 2020 08:39:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:53364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726410AbgF1Mja (ORCPT ); Sun, 28 Jun 2020 08:39:30 -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 CE66C20738; Sun, 28 Jun 2020 12:39:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347970; bh=9eNDv1CmBLwsXlChrkB+Yomsxb7eXDjKajABk03fLm8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bsMKwraAPfnmIkkpc8QiDjHw0wSNeQ0jso3jLEXynBn22PLebnUKCgSMhrxOGpTVg HO/E9ZfjKWKY3QKxod5bzkcAFXwvKm7jfdinQ7RdN/EC/e667oZ1t4ziI6UCugQFqE 33SAXZ4DQ3ku+gBPYeOD9c8zkdIjWqi/TOhgRNqM= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron , Raveendra Padasalagi Subject: [PATCH 22/23] iio:adc:bcm_iproc: Drop of_match_ptr protection and switch to mod_devicetable.h Date: Sun, 28 Jun 2020 13:36:53 +0100 Message-Id: <20200628123654.32830-23-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 Whilst it's unlikely that this driver will ever be instantiated from ACPI PRP0001 there is little advantage in using the of_match_ptr protection. The switch of header is because we only use of_match_id in here and that is defined in mod_devicetable.h not of.h. Note the main reason for this patch is to avoid providing instances of of_match_ptr being used in IIO that might get copied into new drivers. Signed-off-by: Jonathan Cameron Cc: Raveendra Padasalagi --- drivers/iio/adc/bcm_iproc_adc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/bcm_iproc_adc.c b/drivers/iio/adc/bcm_iproc_adc.c index 936da32faa9d..44e1e53ada72 100644 --- a/drivers/iio/adc/bcm_iproc_adc.c +++ b/drivers/iio/adc/bcm_iproc_adc.c @@ -4,7 +4,7 @@ */ #include -#include +#include #include #include #include @@ -617,7 +617,7 @@ static struct platform_driver iproc_adc_driver = { .remove = iproc_adc_remove, .driver = { .name = "iproc-static-adc", - .of_match_table = of_match_ptr(iproc_adc_of_match), + .of_match_table = iproc_adc_of_match, }, }; module_platform_driver(iproc_adc_driver); From patchwork Sun Jun 28 12:36:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11630135 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 88EBC13B4 for ; Sun, 28 Jun 2020 12:39:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 70A3420738 for ; Sun, 28 Jun 2020 12:39:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347973; bh=gvYRsqJq0Xz0LzGUzRBd/MuchXSB4lB8S8Wj+ceYzCQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=MFhfK2jOASLWjiIR1Hqgl4yQbzb8gVWjcmZ9RszOtTL8yAVPxJzsnms75HUuRt/ir fyAshmbDlgSl3UpZM+4Dv1jjT/mnnMq4kmjY0A8Qf9QdxlDxN7G4XENoFO0X6qxkR8 mFCjQX0ZHq6ieH6XI7j4CxTdgLcMh4cZnrvj+WTM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726567AbgF1Mjc (ORCPT ); Sun, 28 Jun 2020 08:39:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:53378 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726410AbgF1Mjc (ORCPT ); Sun, 28 Jun 2020 08:39:32 -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 3B5962076E; Sun, 28 Jun 2020 12:39:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593347972; bh=gvYRsqJq0Xz0LzGUzRBd/MuchXSB4lB8S8Wj+ceYzCQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FNt6yY5GaL9T0Smh5c2mvJIX8DnjSjmacK2sFrMHcablESNvLYf8L+33tRu4ViSAw OfgiQFldVpFReJKU2A+mGOeDX4YrdZBjLaCFIPwNg97bGCFdbq8hgHu0Ri1/V7/d1y V70jPMGsixvT9aJpQ/n6fTf004isu8t1dwPgKXBk= From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: alexandru.Ardelean@analog.com, Andy Shevchenko , Jonathan Cameron , Artur Rojek Subject: [PATCH 23/23] iio:adc:ingenic: drop of_match_ptr protection and include mod_devicetable.h Date: Sun, 28 Jun 2020 13:36:54 +0100 Message-Id: <20200628123654.32830-24-jic23@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628123654.32830-1-jic23@kernel.org> References: <20200628123654.32830-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 Whilst it's unlikely this device will ever be instantiated using ACPI, there is little advantage not assigning the of_device_id table in all cases and it avoids providing an example that might be coppied into new drivers. Also include mod_devicetable.h whilst here as of_device_id is defined in there so including the header is best practice. Signed-off-by: Jonathan Cameron Cc: Artur Rojek --- drivers/iio/adc/ingenic-adc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/ingenic-adc.c b/drivers/iio/adc/ingenic-adc.c index 3ea097c9650e..fa7ae7f6677e 100644 --- a/drivers/iio/adc/ingenic-adc.c +++ b/drivers/iio/adc/ingenic-adc.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -497,7 +498,6 @@ static int ingenic_adc_probe(struct platform_device *pdev) return ret; } -#ifdef CONFIG_OF static const struct of_device_id ingenic_adc_of_match[] = { { .compatible = "ingenic,jz4725b-adc", .data = &jz4725b_adc_soc_data, }, { .compatible = "ingenic,jz4740-adc", .data = &jz4740_adc_soc_data, }, @@ -505,12 +505,11 @@ static const struct of_device_id ingenic_adc_of_match[] = { { }, }; MODULE_DEVICE_TABLE(of, ingenic_adc_of_match); -#endif static struct platform_driver ingenic_adc_driver = { .driver = { .name = "ingenic-adc", - .of_match_table = of_match_ptr(ingenic_adc_of_match), + .of_match_table = ingenic_adc_of_match, }, .probe = ingenic_adc_probe, };