Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1338138lqg; Sun, 3 Mar 2024 05:50:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCURioWE2lhwofEoAJQeOzymZvcqSLAaUHbCfkeWGQ1X32/YXGV7hRNU7P5pn0aNqVx+Ou+EXdGZi0M303P4NpgfWeVUT9cU2pNDCucIdQ== X-Google-Smtp-Source: AGHT+IGF+Bdsh/Mdt5GrfrnAZBLzlY4Eahc3wL9mp+AgvW/p4glC0Gj/OnNzjW+yXxUHMn9kG0bR X-Received: by 2002:a17:906:ce29:b0:a44:2218:4817 with SMTP id sd9-20020a170906ce2900b00a4422184817mr4276480ejb.39.1709473849967; Sun, 03 Mar 2024 05:50:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709473849; cv=pass; d=google.com; s=arc-20160816; b=0H1rt8sJEQGBIgIrIQ66oG/9nwTKV3mycy36DrQ3nq0YY8a5FIayYSyZtskzFhLSr+ o4H1TF5Q1rkqbqtsuCRzbcT0eORvPXb37DqseUO0+rXnKmxhOcH+fzHYNL7psuYt5dHP e1aUKYw7CxujbvMkW5IMVRqbZDOb4dUiQASP08hAXZWnjqkTvIZ5uj4F33A7+z1PR2Js M4SQJpnpiebPpHJz/ZJ4AgF1vBXW808lUJoR2JCWMR7b44ACEqt9nup+0AOPjFMWIVYO m6O+IkryTEp21Nnv/+udre4GvIdhuppPdrkdvPKlhNzN3/J9gxzt/TZElV3L9YDmzA+W rTRg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=B091QNNQEY0ZnGFW/KRYswg7MfcLR6w83AZB+AY8CIc=; fh=wuM7dqyi8AE4NS04h4uaPlFJ2HVnlDVBcl4Xw+Lqbn4=; b=0Q4zLyUZqcLZiOjXFnmdx+VytiWYKBESGG2PGNJYMGDIMoQFNScF2r15Yom6gc5W7C WNnkadYssdi3HC9D0oVFZzQHjlRzks9K17W2q0xiM0FSdF1OU46/9+kPF2rX8Uyc5c5q fHzKwjtRt/q7D8zPejpM4cahqJWu1Mybh9GlLah3zBMuE2Hn0HCT/Gsspwn7u0wS5UQP loXs8naMxs1MHVhUlfDhYggDv44fiDOgWlxfYyLQfiGYvf+iQS6GdLnPsHCxRm8ic3ID 56rLi5pp2NKJ5IozTrHDhEbU1ZKMLIIyLy+Mpl+zvvrWvYgJ3c1BqLOn8lDVlhTjWVdA /fdw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rY0cGOtr; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-89763-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89763-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ne7-20020a1709077b8700b00a45446d1b43si44854ejc.331.2024.03.03.05.50.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 05:50:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89763-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rY0cGOtr; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-89763-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89763-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B01181F223BD for ; Sun, 3 Mar 2024 13:50:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 23C2E59B64; Sun, 3 Mar 2024 13:50:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rY0cGOtr" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42DC0A957; Sun, 3 Mar 2024 13:50:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709473842; cv=none; b=b8HkJe8LbISvadyMTINFwPxyeYx/nd3QMUwbAKoGwibgzn2a/FFEeAYeRZEBJDFXyesayoDtKK/niG8wddsyBL7pMaQg+0t8SERKX8u9toTLdNAxR4Xs/Fi5OldjOGpmgyRStt8FCFVfYULfVm6l3RXRIw7UnITX1jeegDF/Cvs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709473842; c=relaxed/simple; bh=cLGjYnegpEWxWvkDnB472eI87+/tPnQpAUYZmm2aSo0=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EP9po9ZaKm+TreobqObQXwr1K6oke6ICu9j2E9A4gSQjUFt2Dfn09lIXwK375tGORl4RT0XSPHF6o+d+EkgrgzJOv4w0sFpNhescq7MBnQvlv4h5+gVHpAO4+db0nJOEx+pSe7q44SJmiiAERBTkBVPFJ5bqijZAXhhQmckJWvw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rY0cGOtr; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5C9CC433C7; Sun, 3 Mar 2024 13:50:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709473841; bh=cLGjYnegpEWxWvkDnB472eI87+/tPnQpAUYZmm2aSo0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=rY0cGOtr2PVnKTQSCT9oVGnoJnn0WzUFeOVgSE25SGvcvxMglR/VtfuMnwAtDn+Ta ygDJLO9kj46ngEG/yoXrxpAWQdnE02CT2Cu3f/KWvU/45Gw3TTYvBf2OodU7PgS8qQ pG7REWTAFWYvSm3aFCXg0dM8GnRvzA8IlZi73WTltDXSFPr7Ki3iEykFBmsWygYyWO Gbn8SCs2PW47BvJxFwHTp/AWe6AUDpl0NWzeul1gU82HhNBmJlq9IhHkeXQRGF7Mq5 e2JhHA90r86pz7KDzL/rKtLEZQSj/JuqBeIrqENH9Ulj3HAWVwF8TqQPGRG1/Gabcp poOWZwIqSH4Qw== Date: Sun, 3 Mar 2024 13:50:28 +0000 From: Jonathan Cameron To: Andy Shevchenko Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Lars-Peter Clausen Subject: Re: [PATCH v1 1/1] iio: adc: twl4030-madc: Make use of device properties Message-ID: <20240303134746.0d145b6d@jic23-huawei> In-Reply-To: <20240228205927.3681321-1-andriy.shevchenko@linux.intel.com> References: <20240228205927.3681321-1-andriy.shevchenko@linux.intel.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, 28 Feb 2024 22:59:27 +0200 Andy Shevchenko wrote: > Convert the module to be property provider agnostic and allow > it to be used on non-OF platforms. >=20 > Include mod_devicetable.h explicitly to replace the dropped of.h > which included mod_devicetable.h indirectly. It seems fairly implausible anyone will use this ancient device with any other firmware, but as conversion is trivial and provides one less place for people to copy of specific handling from i tried applying it. However it doesn't build... drivers/iio/adc/twl4030-madc.c:754:24: error: =E2=80=98np=E2=80=99 undeclar= ed (first use in this function); did you mean =E2=80=98up=E2=80=99? 754 | if (!pdata && !np) { | ^~ | up I guess !dev_fwnode(dev) instead? Jonathan =20 >=20 > Signed-off-by: Andy Shevchenko > --- > drivers/iio/adc/twl4030-madc.c | 14 ++++++-------- > 1 file changed, 6 insertions(+), 8 deletions(-) >=20 > diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-mad= c.c > index 4a247ca25a44..a7b6b81014de 100644 > --- a/drivers/iio/adc/twl4030-madc.c > +++ b/drivers/iio/adc/twl4030-madc.c > @@ -19,10 +19,12 @@ > #include > #include > #include > +#include > +#include > #include > +#include > #include > #include > -#include > #include > #include > #include > @@ -30,7 +32,6 @@ > #include > #include > #include > -#include > #include > =20 > #include > @@ -746,7 +747,6 @@ static int twl4030_madc_probe(struct platform_device = *pdev) > { > struct twl4030_madc_data *madc; > struct twl4030_madc_platform_data *pdata =3D dev_get_platdata(&pdev->de= v); > - struct device_node *np =3D pdev->dev.of_node; > int irq, ret; > u8 regval; > struct iio_dev *iio_dev =3D NULL; > @@ -779,7 +779,7 @@ static int twl4030_madc_probe(struct platform_device = *pdev) > if (pdata) > madc->use_second_irq =3D (pdata->irq_line !=3D 1); > else > - madc->use_second_irq =3D of_property_read_bool(np, > + madc->use_second_irq =3D device_property_read_bool(&pdev->dev, > "ti,system-uses-second-madc-irq"); > =20 > madc->imr =3D madc->use_second_irq ? TWL4030_MADC_IMR2 : > @@ -905,20 +905,18 @@ static void twl4030_madc_remove(struct platform_dev= ice *pdev) > regulator_disable(madc->usb3v1); > } > =20 > -#ifdef CONFIG_OF > static const struct of_device_id twl_madc_of_match[] =3D { > { .compatible =3D "ti,twl4030-madc", }, > - { }, > + { } > }; > MODULE_DEVICE_TABLE(of, twl_madc_of_match); > -#endif > =20 > static struct platform_driver twl4030_madc_driver =3D { > .probe =3D twl4030_madc_probe, > .remove_new =3D twl4030_madc_remove, > .driver =3D { > .name =3D "twl4030_madc", > - .of_match_table =3D of_match_ptr(twl_madc_of_match), > + .of_match_table =3D twl_madc_of_match, > }, > }; > =20