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 D003BC4332F for ; Sun, 13 Feb 2022 18:17:33 +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=pNS51MGQOkZL4aVLt9iZjHPeC2T/YZaO0ja/ha9FOFg=; b=q83iWCqHbOwbqp CaPqVqjIijMyWWB1qacp9mVOeqZuaiWDglljalqm+QS+9uc9hqaLRr47SoMVdakc94WVEMQ1MVD2O I+Hr3djKlCBr9IFHjEjIFR0Pc5zORxRi2fUhw0ydxJwX+Bpx3m9jsQVzVi2fIRtd64Lbfw2QSRZ/x NO1BmR6AHkhKNBmc8RUauXLp6h0te/EYEm1EnYqD4mCSsoYZ69Uda+qBGnF6DOIEfPQWhEvKH2SV4 60RUXTqF+HrUxJzIObOKDOyX0/LPt9+m3tjdH44n4YgJ6pYMQW0SlYMUEbCDdAIK6Ovx8FvN2i7F/ FNb2JSaQ1xfjqzhK32iw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJJPa-00CJnV-1w; Sun, 13 Feb 2022 18:15:50 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJJPU-00CJmg-QP for linux-arm-kernel@lists.infradead.org; Sun, 13 Feb 2022 18:15:48 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5673AB80B4C; Sun, 13 Feb 2022 18:15:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3EF62C004E1; Sun, 13 Feb 2022 18:15:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644776141; bh=/9+H4j9CNkoA0PauWus1aCeeU0uGh7nZTlRZF36Y6lc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=irYBWrUPCh9Z0yNMJwq02yyDHRElWuHRxCQzd8WYWSW1ByL7EnWJwCskD2ODfY/bz f2OiiMXzOYw12ykSXkhvmAThkMQVjSbLetHhZSx4Wv4Nh1Sh5Jg5WQ+yjCoCVrJn97 th9ZTIG+Bkrea37dRMg50EsqBbrF5T4AhI883E7Prg4nn0Qw7PdQb2MbdbteeWs9Iv aAImGW52TYeQyVILzp/aNPIOEQHYqPTKBR6ZuRIwFPNCDW2h4TkZ6xEXMtCCVl5HtQ acg2ICRTpd60RX31stEhUTTH9YxTYqQI4kawkFMGM0MEzMpzhbrMhuh0ILZwuNhM2o mcoRbOYuJthcw== Date: Sun, 13 Feb 2022 18:22:20 +0000 From: Jonathan Cameron To: Fabrice Gasnier Cc: Andy Shevchenko , Jonathan Cameron , , , , , Lars-Peter Clausen , Maxime Coquelin , Alexandre Torgue , Olivier MOYSAN Subject: Re: [PATCH v2 1/1] iio: trigger: stm32-timer: Make use of device properties Message-ID: <20220213182220.3c045159@jic23-huawei> In-Reply-To: <05babdec-fd9a-a674-23a5-c689ff8fa8e3@foss.st.com> References: <20220202204112.57095-1-andriy.shevchenko@linux.intel.com> <20220205173114.5a60fc47@jic23-huawei> <05babdec-fd9a-a674-23a5-c689ff8fa8e3@foss.st.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; 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-20220213_101546_764364_CD15E34A X-CRM114-Status: GOOD ( 27.70 ) 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 Wed, 9 Feb 2022 15:24:22 +0100 Fabrice Gasnier wrote: > On 2/5/22 6:31 PM, Jonathan Cameron wrote: > > On Wed, 2 Feb 2022 22:41:12 +0200 > > Andy Shevchenko wrote: > > > >> Convert the module to be property provider agnostic and allow > >> it to be used on non-OF platforms. > >> > >> Signed-off-by: Andy Shevchenko > > Looks fine to me. The stm32 drivers are well maintained so I'll > > leave this one on list a little longer for feedback. > > > > +Cc: Fabrice > > > >> --- > >> v2: dropped depends on OF > >> drivers/iio/trigger/Kconfig | 2 +- > >> drivers/iio/trigger/stm32-timer-trigger.c | 11 ++++++----- > >> 2 files changed, 7 insertions(+), 6 deletions(-) > > Hi Andy, Jonathan, > > You can add my: > Reviewed-by: Fabrice Gasnier Applied to the togreg branch of iio.git and pushed out as testing for 0-day to poke at it and see if we missed anything. Thanks, Jonathan > > Thanks, > Best Regards, > Fabrice > > >> > >> diff --git a/drivers/iio/trigger/Kconfig b/drivers/iio/trigger/Kconfig > >> index 8cef2f7452e8..7ecb69725b1d 100644 > >> --- a/drivers/iio/trigger/Kconfig > >> +++ b/drivers/iio/trigger/Kconfig > >> @@ -38,7 +38,7 @@ config IIO_STM32_LPTIMER_TRIGGER > >> > >> config IIO_STM32_TIMER_TRIGGER > >> tristate "STM32 Timer Trigger" > >> - depends on (ARCH_STM32 && OF && MFD_STM32_TIMERS) || COMPILE_TEST > >> + depends on (ARCH_STM32 && MFD_STM32_TIMERS) || COMPILE_TEST > >> help > >> Select this option to enable STM32 Timer Trigger > >> > >> diff --git a/drivers/iio/trigger/stm32-timer-trigger.c b/drivers/iio/trigger/stm32-timer-trigger.c > >> index 4f9461e1412c..5049d9ecfc1a 100644 > >> --- a/drivers/iio/trigger/stm32-timer-trigger.c > >> +++ b/drivers/iio/trigger/stm32-timer-trigger.c > >> @@ -11,9 +11,10 @@ > >> #include > >> #include > >> #include > >> +#include > >> #include > >> #include > >> -#include > >> +#include > >> > >> #define MAX_TRIGGERS 7 > >> #define MAX_VALIDS 5 > >> @@ -771,11 +772,11 @@ static int stm32_timer_trigger_probe(struct platform_device *pdev) > >> unsigned int index; > >> int ret; > >> > >> - if (of_property_read_u32(dev->of_node, "reg", &index)) > >> - return -EINVAL; > >> + ret = device_property_read_u32(dev, "reg", &index); > >> + if (ret) > >> + return ret; > >> > >> - cfg = (const struct stm32_timer_trigger_cfg *) > >> - of_match_device(dev->driver->of_match_table, dev)->data; > >> + cfg = device_get_match_data(dev); > >> > >> if (index >= ARRAY_SIZE(triggers_table) || > >> index >= cfg->num_valids_table) > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel