Received: by 2002:a05:6500:1b8a:b0:1ef:a0f1:aef6 with SMTP id df10csp140636lqb; Sun, 10 Mar 2024 08:17:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXiQCq8IBKi+tc0TQY7XDl3TNLEI3+0tSwtYvb0JiL1u1knnquLP4Da/xGSB5qV9eqc3qQMi1IvQcWTITqV31PIZD8W7vqEbXxCvbT4dw== X-Google-Smtp-Source: AGHT+IHLv2wjXhzxpVNid+gQZSvnPvMxBXewPqCBmTaa3w90IomzRl2m+68xD1xReuB+JxjCIhCe X-Received: by 2002:ac8:5cc4:0:b0:42f:208a:3b85 with SMTP id s4-20020ac85cc4000000b0042f208a3b85mr7787483qta.45.1710083836838; Sun, 10 Mar 2024 08:17:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710083836; cv=pass; d=google.com; s=arc-20160816; b=MMLM+UX5d54e9C0y8OKc81cHz1/z63XK3uFsG/lMIO6c50E736m0jQcm6dhQW+nDTc +Izqjzwj/XpTH2CpJXnx0zG4nNw8aAt1f+cij2fw+jpfXap8e01pEmTvnQmRyr9x0WJy Ufp/+hz+aCl1az1onqeHKCZbSFwDBI/mUrIvQazgKgkyrS+VSY5o59wCX5/PhyhwtVj8 1RswN+o2s9UXVo9xR8OB78xCBs7lxpPQ9PD1AUs0YkAJ+shA2L7CoFFulkJ5gW8J+pvt 71HYGE3EpoSqCnA8D28Zx0xJbRkhkicYA8iG6fe7pxMvyvSCIayzCXi+SnbSI2vZB+Om acsA== 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=pBAzF1WY2+lVurK4Dd15VFMoR5ps8c0sl1l6iTxElSA=; fh=VAblra/hd9P/x3sPYOriZo03L1doL2GdECM5aLQe2QM=; b=sHcRlN14HCcAPZR0+Bf/aDDAtIzMMZtZ1NUathSjlDeFWIPB242SKD4fp1wqKrVQ0m 7IMpPVEOm4BpFZiI3rl7AqzAKKpZb+ywAktd9rNRhvJlznPN6Hl4MsKRaJpssHxUN0Kn rB8RVwefmLZKD2gk+AK9F5rNj3T+g1v7RivrBRErWrQklOBW+XYVLju1jRokRqhD8rt0 ZE0gxagoG6JcI7aopAMHFmkoD+GOZ6cWI+fqUqVyPv53EghI0BNO/2tULJS2HFzB5EEs PMNeYUzMkuvrLL6N+crQ3j8opu5x3ilGExq7aiVdAt0C7Vzsh5K52CQifrG6Ub7nPVkI K7Pw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hAv52yyI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-98251-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98251-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id r10-20020ac85c8a000000b0042eec9e3009si3553156qta.199.2024.03.10.08.17.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Mar 2024 08:17:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98251-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hAv52yyI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-98251-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98251-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 8D1DC1C208B5 for ; Sun, 10 Mar 2024 15:17:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 51FD3381C2; Sun, 10 Mar 2024 15:17:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hAv52yyI" 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 7ABA0374C3; Sun, 10 Mar 2024 15:17:08 +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=1710083828; cv=none; b=s97bcaD1iSkVH2TuWa2jNjMTmDPQTB4fQFd5v0CQ52rrkLDmChBJp/h0n8T+yFn71zmJDCKV6iwuomkiWJwgweQ/ShSac3g50u6WVn4PzWHwYs3MqEkoGXdTJS5PPHQf9uxl8Ct6kZCR9JDCe6LfKiX7umjAkM9GX/Lae1+sNSg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710083828; c=relaxed/simple; bh=rIUrM1eqzy59I4K5wq1eEGWnue1gxNqb95RwtlVisTY=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=g0pbG9OaeVnVmPy1ZcuRZsL5p34A3LOekkPI6jNIAjeOQdPXqORCg2vhgsk2PORp0xEnKwpjduMQYJmgj6cLgaLsWmbH4Pib6/zpAQEJIfwMo8+YvGkcH0eh2k5FOk0heSw0Q94vyNC4QXOsbSDNQkt2rjP+sILf1v1ASbUK9X0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hAv52yyI; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5738C433C7; Sun, 10 Mar 2024 15:17:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710083828; bh=rIUrM1eqzy59I4K5wq1eEGWnue1gxNqb95RwtlVisTY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hAv52yyIPsDx6Tpr1n0tlteWz1lKsJ3y9Fbz1aT+TgV2RKOwoejhpgb9IcnaGd092 csRYF3YN+ui+HPyByVgaAdwcvKJWMr+xD+yRGTY5Xj/qgSHYtau8Kn2zGKifT7B0j8 jiGdM3o4m2YQ7HwnSHkkXD/cJSIx75mqsF5AzaORMknVgrPHRfsCt7WlKqI5q/h0sB IarZKiRUJYO7P5XW6Bvu7M00j8MI40/tUiX+soJXeiW0qeVubzMiLTBcf5qAxLALu7 ZQvM7wpcB6hlOtKopbaKWaHrTx6g9FfleRrUC+yrLuHtuUcmn1HyuScsMJeya+fl6o riDfc8Uf1zN5A== Date: Sun, 10 Mar 2024 15:16:54 +0000 From: Jonathan Cameron To: Andy Shevchenko Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Lars-Peter Clausen , Uwe =?UTF-8?B?S2xlaW5lLUvDtm5pZw==?= Subject: Re: [PATCH v2 1/1] iio: adc: twl4030-madc: Make use of device properties Message-ID: <20240310151654.754c5da0@jic23-huawei> In-Reply-To: <20240304144037.1036390-1-andriy.shevchenko@linux.intel.com> References: <20240304144037.1036390-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=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 4 Mar 2024 16:40:06 +0200 Andy Shevchenko wrote: > Convert the module to be property provider agnostic and allow > it to be used on non-OF platforms. > > Include mod_devicetable.h explicitly to replace the dropped of.h > which included mod_devicetable.h indirectly. > > Signed-off-by: Andy Shevchenko Thanks Andy, Applied this to the togreg-cleanup branch of iio.git. I wondered whether there were any users of the platform_data / board file path left. Seems that the support for the parent mfd platform data was ripped out by Uwe in 2022 but not the sub drivers. Anyone want to do the work to drop it from here and the other sub drivers? Jonathan > --- > v2: converted leftover (Jonathan) > drivers/iio/adc/twl4030-madc.c | 19 +++++++++---------- > 1 file changed, 9 insertions(+), 10 deletions(-) > > diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c > index 4a247ca25a44..0253064fadec 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 > > #include > @@ -744,14 +745,14 @@ static int twl4030_madc_set_power(struct twl4030_madc_data *madc, int on) > */ > static int twl4030_madc_probe(struct platform_device *pdev) > { > + struct device *dev = &pdev->dev; > + struct twl4030_madc_platform_data *pdata = dev_get_platdata(dev); > struct twl4030_madc_data *madc; > - struct twl4030_madc_platform_data *pdata = dev_get_platdata(&pdev->dev); > - struct device_node *np = pdev->dev.of_node; > int irq, ret; > u8 regval; > struct iio_dev *iio_dev = NULL; > > - if (!pdata && !np) { > + if (!pdata && !dev_fwnode(dev)) { > dev_err(&pdev->dev, "neither platform data nor Device Tree node available\n"); > return -EINVAL; > } > @@ -779,7 +780,7 @@ static int twl4030_madc_probe(struct platform_device *pdev) > if (pdata) > madc->use_second_irq = (pdata->irq_line != 1); > else > - madc->use_second_irq = of_property_read_bool(np, > + madc->use_second_irq = device_property_read_bool(dev, > "ti,system-uses-second-madc-irq"); > > madc->imr = madc->use_second_irq ? TWL4030_MADC_IMR2 : > @@ -905,20 +906,18 @@ static void twl4030_madc_remove(struct platform_device *pdev) > regulator_disable(madc->usb3v1); > } > > -#ifdef CONFIG_OF > static const struct of_device_id twl_madc_of_match[] = { > { .compatible = "ti,twl4030-madc", }, > - { }, > + { } > }; > MODULE_DEVICE_TABLE(of, twl_madc_of_match); > -#endif > > static struct platform_driver twl4030_madc_driver = { > .probe = twl4030_madc_probe, > .remove_new = twl4030_madc_remove, > .driver = { > .name = "twl4030_madc", > - .of_match_table = of_match_ptr(twl_madc_of_match), > + .of_match_table = twl_madc_of_match, > }, > }; >