Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2149095pxb; Wed, 2 Feb 2022 23:43:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQRk9091dfP/NSjAepO53L0nxzMzUvt87RYOntih5IAZkk9JCjlK2IrCwV4ceM0tfkN/Ci X-Received: by 2002:a05:6402:348a:: with SMTP id v10mr33991793edc.249.1643874210258; Wed, 02 Feb 2022 23:43:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643874210; cv=none; d=google.com; s=arc-20160816; b=vJXyELpk3prAYi1QvRHTDmUtO/5dhzcjmTRpEVgMuF72IxGPYTlO5vP+8otSruTVqB z7pPKhxLfj/TJ17KSNqgn6eu4Wwki5PxXt6DuEL9tIn3+UQqFH2zPw4K3xyTPRQzbYZZ D8NnUO7AUHFeKIVIB32LA8mAmVXQuLphVSQUOTaKyhFenBCiaunElVH5CJKGxfwiZsL6 lV0JqUNb5a35okKZXE/VGJOixIk5yh+fNPDiZ6QaV/MEd955+Jz32ZjLc7vagmsR23TW Xs3hPSIb0D1klJp1VIzQjaA0ft4FtvMDenuSbB8Lxt8ryLSJPJPMmKaXsuIyxDOxbRuK 8M7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=iU+UcRvkpouiY9H6D8y5EzSLP793y9PM/R+chII6RJY=; b=NF0p0GpylZwA3E03sVRf7B4cwDXmnaQL0r/GjyEysFCP53ptBbeYEKjSVxCwpvuYxw bOXVhnQ/SXrNvu9ytUo5ay8z2WPrskpFXdyoy6XEWLfhweAZ0g+mhrFVMUTP2R3wboBy e4LvOR7i3PfvWHVmv50I2dWuSpDe7FfWCwXyN9KXu0IdX1J+D60wNrrNSyRQ550/AqJs vWlSJ9tJgRV6dJ9JbRw6sLSf5hxc4bVnCreOX6mWghHZ/YcFFNiKa3M1mKQy+1k4tfBd mIHiGu5nabnQyt7SsZ/KFxxP+R+cj0/P0I9jTYJFxhzVJNbjqu2DoYPZqXJqWY/3sray lPmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OFdlf4pa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x20si12731885edi.445.2022.02.02.23.43.05; Wed, 02 Feb 2022 23:43:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OFdlf4pa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347246AbiBBUlE (ORCPT + 99 others); Wed, 2 Feb 2022 15:41:04 -0500 Received: from mga11.intel.com ([192.55.52.93]:64552 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236025AbiBBUlD (ORCPT ); Wed, 2 Feb 2022 15:41:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643834463; x=1675370463; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=fwqpD2EU+5lo59KNZLuxS0tYAkWcxiSqD82vE7PYk2o=; b=OFdlf4pasySv2U1N7wOdZqrpFC2+r8mDoyjwsHfiACkiG8pxa9PXD5Ce hT9cSLv+25aYCIzahX37i6F3ZjAJlHXc7yfAR7tb4bCR/ZKhPJYmx/U1X OGL+sxFxircn/MBLd3LUIYZiab9AnMkSUPNmrzVfDZXi6RLvSbvbjIYtw 3lbSb2yOZyCLN9Yf0niLQWM7nZioOpSkb2D5D9PYK3RSIIGYXZKo9yooE HntdBSopLnplpI1jsxWqusQkmIg4QL4S4QZecdpspjwZIsnfboUVSMT7r GCxs0NzNMFXEM8bwQkon+f/Fzfs3cUpnRw7X2gju9rQAwEixojwals6Ib Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10246"; a="245612904" X-IronPort-AV: E=Sophos;i="5.88,337,1635231600"; d="scan'208";a="245612904" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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