Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1620248rdg; Sat, 14 Oct 2023 09:19:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdyhmDMHjDywN8o2V7BT8SSQdrxqTHwxeK82YxHnONuMeYlaznBQgHyp12CxfPErHBpq6P X-Received: by 2002:a05:6808:21a4:b0:3ae:2b43:dd47 with SMTP id be36-20020a05680821a400b003ae2b43dd47mr39579286oib.22.1697300357209; Sat, 14 Oct 2023 09:19:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697300357; cv=none; d=google.com; s=arc-20160816; b=jo1yi+D441SB59TXV2gc35oRaqlF7OC+U85HwT3Je0c/OSPLhhBf0iH9nW1vELkD5+ H4oNN6CxvL/pWHbGhTk5G8E896wVSXP4RQVTFy3k3vLAlm888LU8svKgzpLAEA0HYcQ3 rOfs/xLMKE/ImqaIxgpoqMOZgKe+oQng2Joacp8BFgQ1bQog86bCfwaztHmY9vPe5zRj YnpgkcNLngYl1qBfQw24HPoNSXLggbNs1cZLpfdpcRm/IlDZsBra54W2YTHSB204165S rW+lEjXZ46IJrjnxplaK8giNAuaJhWy7yD9Qzv8gvpDtt2N5P+JCol6shczLBC+qN1K0 /XBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=s8slSGV8YigPXg+WDadyvrbo6moUhXW84UE3glgAjIs=; fh=QOMzsk/dhyp5MOvWPX/CzieWKf3KKwQTOX212kgkuCw=; b=xJh6HfYQTp6Z9AsowoKM3uy+60qlyY6ZhkF0dqobEjZB+uPHdKLWyzj+NsdasHcIK8 xi2dM0vl1eDJBjHhfn8ct2+vPceX3G/QyRGRJ3XR4Nke7qnHURW6n4PjU+/wk7jEha+h AZZtYtd1F2MzFiEmrnXYVYfE9wr7/ay1iHL+m4Wc6x4H2mRALF49JkBPy7RuujcruVY4 XLL6Cs5Gmsnnc6+FrAOXRIDaTyEnoCaqTWj49yOgIgmYQ04rf9KHt0SuQSFmdKBWrjzF vfzfCYzY++iJuKDt9MVmpDTqUQbrQt3qkwIu8v675Xsc5jxInI8aaPPZ7GJ2Bw5uHYOP 3+rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=W11XEmFF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id g20-20020a17090ace9400b00273f61d8773si2485173pju.160.2023.10.14.09.19.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Oct 2023 09:19:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=W11XEmFF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id E86268029343; Sat, 14 Oct 2023 09:19:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233238AbjJNQSz (ORCPT + 99 others); Sat, 14 Oct 2023 12:18:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230016AbjJNQSy (ORCPT ); Sat, 14 Oct 2023 12:18:54 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D625A2; Sat, 14 Oct 2023 09:18:53 -0700 (PDT) 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 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sat, 14 Oct 2023 09:19:15 -0700 (PDT) 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))