From patchwork Tue May 31 21:39:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12866189 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 231F3C433FE for ; Tue, 31 May 2022 21:39:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348066AbiEaVj2 (ORCPT ); Tue, 31 May 2022 17:39:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239372AbiEaVj0 (ORCPT ); Tue, 31 May 2022 17:39:26 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 349C173553; Tue, 31 May 2022 14:39:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654033166; x=1685569166; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=W3LGc6UbOk46vOqseuqFkVY/oNvVjxu8CVHv7UXo3n8=; b=WhYWn8FklYhVLU/W2xrPIo6q7rP8kB041IRJAuxCUKPeCTCClBY3J6sB VdMInFByGhqGX/pYaOvyW+9H1ITxwGB6PoiXYvNMb/o28ybVsxlw+ySJq oXjXs44IGkkI2C3nrAvRAONA63/6GTq0p70wUwBDfu09vtS/J3CzjOPHt 74mbGXCmlr2G6EBxFJ8i8G1YEB3qrDBAUBDg0ByrHFdes/td7OhPyOPJF xbkvUmw/CSwcUvc/3JGai0wE0t+fftEZHAyC4FP3AJT8pBez1vdIJZmkJ FGWSU9zLmoxqkGK3w8qrCpqPB9UP0393cFSyONFFYKeQFuy7iByW5NoLS w==; X-IronPort-AV: E=McAfee;i="6400,9594,10364"; a="272962029" X-IronPort-AV: E=Sophos;i="5.91,266,1647327600"; d="scan'208";a="272962029" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 14:39:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,266,1647327600"; d="scan'208";a="633237026" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 31 May 2022 14:39:24 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id A7F2CD2; Wed, 1 Jun 2022 00:39:26 +0300 (EEST) From: Andy Shevchenko To: Alexandru Ardelean , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andy Shevchenko Subject: [PATCH v1 2/2] iio: adc: nau7802: Make use of device properties Date: Wed, 1 Jun 2022 00:39:22 +0300 Message-Id: <20220531213922.72992-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220531213922.72992-1-andriy.shevchenko@linux.intel.com> References: <20220531213922.72992-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Add mod_devicetable.h include. Signed-off-by: Andy Shevchenko --- drivers/iio/adc/nau7802.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/nau7802.c b/drivers/iio/adc/nau7802.c index 2d71cdbcd82f..c1261ecd400c 100644 --- a/drivers/iio/adc/nau7802.c +++ b/drivers/iio/adc/nau7802.c @@ -8,10 +8,11 @@ #include #include #include +#include #include +#include #include #include -#include #include #include @@ -411,7 +412,6 @@ static int nau7802_probe(struct i2c_client *client) { struct iio_dev *indio_dev; struct nau7802_state *st; - struct device_node *np = client->dev.of_node; int i, ret; u8 data; u32 tmp = 0; @@ -451,7 +451,7 @@ static int nau7802_probe(struct i2c_client *client) if (!(ret & NAU7802_PUCTRL_PUR_BIT)) return ret; - of_property_read_u32(np, "nuvoton,vldo", &tmp); + device_property_read_u32(&client->dev, "nuvoton,vldo", &tmp); st->vref_mv = tmp; data = NAU7802_PUCTRL_PUD_BIT | NAU7802_PUCTRL_PUA_BIT |