From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E2ADACDB474 for ; Sat, 14 Oct 2023 16:19:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=b5ahEqh1wYSzoRc3yutO39YxYR7lmLw0uK2ZohewcOM=; b=TexnrLFUZKe+Q3 uAbemMzv7B3Q+sSp5hNhsa6xk3z779yTH5d21K4BjDSnBhVvB7WifBPhhwtaA8ZY1t4A6+hAEeRov +uNvPcXRAZzw3VSuwovddh0Tw1rM0KR8FyaWg9+HepaITUfAAupbsaW0LvI2l2XVsVMi6WazO9jtk VGHHq6Rd8H8G8JgC3HCyp/3EAYpd5decervS0QCFdkpRmlw70JOEH/NqAVLo9qd8zp8fNA5tt/tf4 uVcMXbjempxsCnq2x4eaafYa7Yi1buemi9XvtGLxcOziMkw2Kgc/Mpk1ZYyQawJianwE/1NDu64IJ +EogjYXOy7pu/xB8Aprw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qrhLy-005Z55-0B; Sat, 14 Oct 2023 16:19:02 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qrhLt-005Z4g-2d for linux-arm-kernel@lists.infradead.org; Sat, 14 Oct 2023 16:19:00 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 90552B80688; Sat, 14 Oct 2023 16:18:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BCB93C433C7; Sat, 14 Oct 2023 16:18:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697300332; bh=rcHe2IojBHzrFe/8C4CXM2Y34afpD5jZN4BNeTTGPSA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=W11XEmFFSK0FSzKN3yrJEz3qYTacjYsL3JhaN6VQTF9mZFldTjlqSR6aoK1lti0w1 MbJOPOpp+q29FZjYdEG/yl3VkUnQT9Tix6HA+DDLnR4K8+Lft+7FkcmbOW3jOiHQTZ WqP96eL7yigHTCNDOielAkp1WdcApJvCLCUp3SI2MOmFWvNEXzhafV8dL4s73rQqlY 1Jz0TmAozrjQ10YVd9x1PagUkyf1LQpQwprGjCsD40n3F/vkD9gOf0DSrjXHqNdEDJ LZjJzFgHvMR6d9IA9EIr0mRWowuEkKf3A5watNXbKAH2jb/+TfxdkoVrisehlS7tVx EfRrx5CbuYgGA== Date: Sat, 14 Oct 2023 17:19:06 +0100 From: Jonathan Cameron To: Rob Herring Cc: Lars-Peter Clausen , Maxime Coquelin , Alexandre Torgue , linux-iio@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: Use device_get_match_data() Message-ID: <20231014171906.42459f40@jic23-huawei> In-Reply-To: <20231006224440.442864-1-robh@kernel.org> References: <20231006224440.442864-1-robh@kernel.org> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231014_091858_134232_68C4C648 X-CRM114-Status: GOOD ( 20.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 6 Oct 2023 17:44:39 -0500 Rob Herring wrote: > Use preferred device_get_match_data() instead of of_match_device() to > get the driver match data. With this, adjust the includes to explicitly > include the correct headers. > > Signed-off-by: Rob Herring Applied to the togreg branch of iio.git and pushed out first as testing to let 0-day see if it can find any issues that we missed. Thanks, Jonathan > --- > drivers/iio/adc/stm32-adc-core.c | 11 +++-------- > drivers/iio/adc/twl6030-gpadc.c | 10 ++++------ > drivers/iio/dac/stm32-dac-core.c | 9 ++++----- > 3 files changed, 11 insertions(+), 19 deletions(-) > > diff --git a/drivers/iio/adc/stm32-adc-core.c b/drivers/iio/adc/stm32-adc-core.c > index c19506b0aac8..616dd729666a 100644 > --- a/drivers/iio/adc/stm32-adc-core.c > +++ b/drivers/iio/adc/stm32-adc-core.c > @@ -17,10 +17,11 @@ > #include > #include > #include > -#include > +#include > #include > #include > #include > +#include > #include > #include > #include > @@ -708,8 +709,6 @@ static int stm32_adc_probe(struct platform_device *pdev) > struct stm32_adc_priv *priv; > struct device *dev = &pdev->dev; > struct device_node *np = pdev->dev.of_node; > - const struct of_device_id *of_id; > - > struct resource *res; > u32 max_rate; > int ret; > @@ -722,11 +721,7 @@ static int stm32_adc_probe(struct platform_device *pdev) > return -ENOMEM; > platform_set_drvdata(pdev, &priv->common); > > - of_id = of_match_device(dev->driver->of_match_table, dev); > - if (!of_id) > - return -ENODEV; > - > - priv->cfg = (const struct stm32_adc_priv_cfg *)of_id->data; > + priv->cfg = device_get_match_data(dev); > priv->nb_adc_max = priv->cfg->num_adcs; > spin_lock_init(&priv->common.lock); > > diff --git a/drivers/iio/adc/twl6030-gpadc.c b/drivers/iio/adc/twl6030-gpadc.c > index 224e9cb5e147..78bf55438b2c 100644 > --- a/drivers/iio/adc/twl6030-gpadc.c > +++ b/drivers/iio/adc/twl6030-gpadc.c > @@ -16,9 +16,10 @@ > */ > #include > #include > +#include > #include > #include > -#include > +#include > #include > #include > #include > @@ -879,17 +880,14 @@ static int twl6030_gpadc_probe(struct platform_device *pdev) > struct device *dev = &pdev->dev; > struct twl6030_gpadc_data *gpadc; > const struct twl6030_gpadc_platform_data *pdata; > - const struct of_device_id *match; > struct iio_dev *indio_dev; > int irq; > int ret; > > - match = of_match_device(of_twl6030_match_tbl, dev); > - if (!match) > + pdata = device_get_match_data(&pdev->dev); > + if (!pdata) > return -EINVAL; > > - pdata = match->data; > - > indio_dev = devm_iio_device_alloc(dev, sizeof(*gpadc)); > if (!indio_dev) > return -ENOMEM; > diff --git a/drivers/iio/dac/stm32-dac-core.c b/drivers/iio/dac/stm32-dac-core.c > index 15abe048729e..e150ac729154 100644 > --- a/drivers/iio/dac/stm32-dac-core.c > +++ b/drivers/iio/dac/stm32-dac-core.c > @@ -9,9 +9,12 @@ > > #include > #include > +#include > #include > #include > +#include > #include > +#include > #include > #include > > @@ -94,16 +97,12 @@ static int stm32_dac_probe(struct platform_device *pdev) > struct reset_control *rst; > int ret; > > - if (!dev->of_node) > - return -ENODEV; > - > priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); > if (!priv) > return -ENOMEM; > platform_set_drvdata(pdev, &priv->common); > > - cfg = (const struct stm32_dac_cfg *) > - of_match_device(dev->driver->of_match_table, dev)->data; > + cfg = device_get_match_data(dev); > > mmio = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(mmio)) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel