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 9EEB5C433EF for ; Wed, 2 Feb 2022 18:05:28 +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=ltSNcDuowmyzNAQ4Obtv7olmXRbtb3Dz5x8aGCSw098=; b=yUFmMllHUOGRQy RaJRhnAxn4FW0PTKWjQXWsROTuABHw59eCSGk/HqMcipuViY4xpwGpWgDGx9J484A9GOaqWYOzQzz INFnEbUZ7C+d+ygYjEA3t2A0tBU8ga/HJAwtE3K8EbFT7xuwE50RmZ9PatqXpatjF51BYZyaoMxhx UZc+KIAtvYxjHneHBwz+u26DsrKzau1nRzlDFO/p6f5ZxxQUozUrtFY+ytOwwpuqUI1mOLCOVqX25 lKWsbMnI+vPCTRitep7FlXC7NfM61I8FpIdjZ3l8x9rvKuMfooW+a9K/lsDapDs/07RrQVgMQ3Lh7 gJC9Nvk9EWLnJ6KlEiCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFJyi-00GUcn-Bu; Wed, 02 Feb 2022 18:03:37 +0000 Received: from mga12.intel.com ([192.55.52.136]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFJtR-00GSEa-NP for linux-arm-kernel@lists.infradead.org; Wed, 02 Feb 2022 17:58:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643824689; x=1675360689; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=txTKV4GqxfW43WOJ6xN1Pg09D3EcGyQs318zawtFlSE=; b=JfLAiPNblRJu3Kmu1EjL5Klsxi1tqAYpNEcdX6jua77HAhQYgZYAVAZP NQMnzJrfCGD3iKk9tjO/KJur3J2BMbmWqCMlp8iNtXgbCYNXmLsV4/sOT LnG2qmgED2TjAPPanSC57Axn7EVXu8tRoePJLseuvV4mQziC9pUE9pIvO 3Yf5QxnVpUjJLn8CA0YUB5LZHhTTsuD/GByd1bVG9bdk8ShHhREcpmR13 gcvEWYaYlR3yycoW7iyYpaT4CRCdDrTBvxHnMhLYA4LQ6dZweXYFc7Wel tjlNbx9zPifLllcNZBhjousZMv2HxGZ+1NDfBfNbijKOHQjX8YQvPxHX4 g==; X-IronPort-AV: E=McAfee;i="6200,9189,10246"; a="227954541" X-IronPort-AV: E=Sophos;i="5.88,337,1635231600"; d="scan'208";a="227954541" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2022 09:58:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,337,1635231600"; d="scan'208";a="599643976" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 02 Feb 2022 09:58:06 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 6443F3B7; Wed, 2 Feb 2022 19:58:20 +0200 (EET) From: Andy Shevchenko To: Jonathan Cameron , linux-iio@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Maxime Coquelin , Alexandre Torgue , Andy Shevchenko Subject: [PATCH v1 1/1] iio: trigger: stm32-timer: Make use of device properties Date: Wed, 2 Feb 2022 19:58:15 +0200 Message-Id: <20220202175815.54100-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_095809_811930_7991D668 X-CRM114-Status: GOOD ( 14.85 ) 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 --- drivers/iio/trigger/stm32-timer-trigger.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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