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 4409EC433EF for ; Wed, 2 Feb 2022 20:42:20 +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:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=7W8/8Tj25TpVVYlxcmboRtKPfTmw4eFcsqiTo/gbs0A=; b=CYMMUeYHNtUA05 PaopKfZTTbIaBfZyn0cK6wid5gIylkdFJXcSnz8BF0hmLMHiyYEnv4hslspOvGd3p8+BgCbP3nNSL kurJve4o0ZynBAQ4OwcM9ViI8cYi9lfP1dqghQBoVX1gAyIyEpEOtsAph/+y0VkZmOJRDL6RSXrXe gTdudydGAJkOQsRI/ZV5i4/oYjMlM9m3VUIBrKTE/UwG8LGDv5CqKuJBlqRwLPO1gmw/AZ7ukzA4H 0AqQtP22vs+GT2LCgzOS8xRihY1BUtW8xwNErz2ZFA+LjZbAW13j4JPt8S8NmdU5Tiah4M2DD/+Rk if8fRswTkq5oaw6SozBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFMRE-00Gp88-Vm; Wed, 02 Feb 2022 20:41:13 +0000 Received: from mga06.intel.com ([134.134.136.31]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFMRA-00Gp61-DL for linux-arm-kernel@lists.infradead.org; Wed, 02 Feb 2022 20:41:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643834468; x=1675370468; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=fwqpD2EU+5lo59KNZLuxS0tYAkWcxiSqD82vE7PYk2o=; b=bI6ExULUaM2IIGdU+X3IN0ufL3huhH/JdCnlj3wtgXQEk6vF/eqykQBg lGNWeDOKPUtSFEcgewns3TfCxksjPDrOJbsScnNG0WUxHfAccQdSeURqZ xCLnVAowrW903dosEHhNFeL/8urtER/ZSyn6cLa6v3NUr2v6MkXKg7bW4 e4i01+p+GfyGk3Xj9koR+4qfrUvFnbgOY33jNwS3Jag9jgsvcCDNG5kSe 6w6Vm+0CJdPo/gMXHMi7EXNoR6A17vvjBocG8rfaujMSTLRyMU6YjRNEt KmYdBWxh85nQXvK3mTlwo66uqM7LrDsc1z8IjabEqTEHDoj0wTyYKNDHg g==; X-IronPort-AV: E=McAfee;i="6200,9189,10246"; a="308744880" X-IronPort-AV: E=Sophos;i="5.88,337,1635231600"; d="scan'208";a="308744880" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2022 12:41:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,337,1635231600"; d="scan'208";a="676567335" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 02 Feb 2022 12:41:01 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 629033B7; Wed, 2 Feb 2022 22:41:15 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Cc: Jonathan Cameron , Lars-Peter Clausen , Maxime Coquelin , Alexandre Torgue Subject: [PATCH v2 1/1] iio: trigger: stm32-timer: Make use of device properties Date: Wed, 2 Feb 2022 22:41:12 +0200 Message-Id: <20220202204112.57095-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220202_124109_065375_92B24F8F X-CRM114-Status: GOOD ( 16.46 ) 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 Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Signed-off-by: Andy Shevchenko --- 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(-) 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) -- 2.34.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel