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 X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6121BC2D0A3 for ; Sun, 1 Nov 2020 15:05:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 241FB22246 for ; Sun, 1 Nov 2020 15:05:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604243112; bh=+GEcc49WnaNU98e+949vbHD2QenXZXdlGDzRRbFCK7Y=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=TeN4pvyKbQ5duyx2gZNTvyu1idYZXSttySgv+zYzFwRFquyBCayvEi/z6bStn8XKV 06BHt7hpVtQqm0g2JtT2paVhZUW7rdGDtdrM6EFIGG0Nh1c0t+3tg0mSjnKiMXK3PA 3bU6Q5+mLWBgTB8+eQ7+ok2oIiSJSPL7ivTg4f7w= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726549AbgKAPFL (ORCPT ); Sun, 1 Nov 2020 10:05:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:43758 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726458AbgKAPFL (ORCPT ); Sun, 1 Nov 2020 10:05:11 -0500 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CB8E722242; Sun, 1 Nov 2020 15:05:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604243110; bh=+GEcc49WnaNU98e+949vbHD2QenXZXdlGDzRRbFCK7Y=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=VKW6yEV5escyk1e7rjFyfNR2Vt+Q1g1ogARnlJHEgRAgJoHZwgCoPvc8nEXwCLlKK +weK2pc+0PVLsnOschwGjGLiS5XaDW85J7HKBaL82+ebxH7S+5JPJdY9AetXBrdG1v +yB4sPQUBeYUCJ5fhIYr6fylcVn3IJ75gbAYeUG0= Date: Sun, 1 Nov 2020 15:05:01 +0000 From: Jonathan Cameron To: Vaishnav M A Cc: knaack.h@gmx.de, lars@metafoo.de, nish.malpani25@gmail.com, alexandru.ardelean@analog.com, matt.ranostay@konsulko.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, jkridner@beagleboard.org, drew@beagleboard.org, robertcnelson@beagleboard.org, rajkovic@mikroe.com Subject: Re: [PATCH v3] iio: light: tsl2563 change of_property_read to device_property_read Message-ID: <20201101150501.11b2d0a6@archlinux> In-Reply-To: <20201018144338.GA218707@ubuntu> References: <20201018144338.GA218707@ubuntu> X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Sun, 18 Oct 2020 20:13:38 +0530 Vaishnav M A wrote: > Replace of_property_read_u32() with device_property_read_u32, > when reading the amstaos,cover-comp-gain.This opens up the > possibility of passing the properties during platform instantiation > of the device by a suitable populated struct property_entry. > Additionally a minor change to logic is added to remove the > of_node present check. > > Signed-off-by: Vaishnav M A Applied to the togreg branch of iio.git. Initially I'll push that out as testing for the autobuilders to poke at it and see if we missed anything. Thanks, Jonathan > --- > v3: > -modify commit message for readability, mention minor logic change > -include mod_devicetable.h and property.h headers > v2: > -fix commit message > drivers/iio/light/tsl2563.c | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > > diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c > index abc8d7db8dc1..5bf2bfbc5379 100644 > --- a/drivers/iio/light/tsl2563.c > +++ b/drivers/iio/light/tsl2563.c > @@ -12,6 +12,8 @@ > */ > > #include > +#include > +#include > #include > #include > #include > @@ -703,7 +705,6 @@ static int tsl2563_probe(struct i2c_client *client, > struct iio_dev *indio_dev; > struct tsl2563_chip *chip; > struct tsl2563_platform_data *pdata = client->dev.platform_data; > - struct device_node *np = client->dev.of_node; > int err = 0; > u8 id = 0; > > @@ -738,13 +739,14 @@ static int tsl2563_probe(struct i2c_client *client, > chip->calib0 = tsl2563_calib_from_sysfs(CALIB_BASE_SYSFS); > chip->calib1 = tsl2563_calib_from_sysfs(CALIB_BASE_SYSFS); > > - if (pdata) > + if (pdata) { > chip->cover_comp_gain = pdata->cover_comp_gain; > - else if (np) > - of_property_read_u32(np, "amstaos,cover-comp-gain", > - &chip->cover_comp_gain); > - else > - chip->cover_comp_gain = 1; > + } else { > + err = device_property_read_u32(&client->dev, "amstaos,cover-comp-gain", > + &chip->cover_comp_gain); > + if (err) > + chip->cover_comp_gain = 1; > + } > > dev_info(&client->dev, "model %d, rev. %d\n", id >> 4, id & 0x0f); > indio_dev->name = client->name;