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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7ADC2C433F5 for ; Sat, 16 Apr 2022 11:10:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231699AbiDPLNS (ORCPT ); Sat, 16 Apr 2022 07:13:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231663AbiDPLNS (ORCPT ); Sat, 16 Apr 2022 07:13:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFD75D64FE; Sat, 16 Apr 2022 04:10:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 84CA2B81CF5; Sat, 16 Apr 2022 11:10:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE44AC385A1; Sat, 16 Apr 2022 11:10:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650107444; bh=0Rv4QmjdRNCJUGYqIcNP5TFGkDquZlubml/v5/1K/aQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=DecOErG/pn5KG1p8tA3NqPJya+gFPT27dHqv4ByT+KyrA7ZttKykMtAth/MblAYVX 0MzX2VQdOmlSkjFmBYVzbnkcUlpbvaC8P02lCT2YVtVU4sVZYGHQVtI+1+PuwvXHPW 4Na8kzIj2u0y0knj6jubRt8B8m7Jw1KtrdnZoDXJXGEQrBfPcft34z7fU/rUqTy4C5 RY/AXvEqlp6VoxI1RaeCLESwlAqvhTANLCCfAtvZ9hwzDV/P1hHFQJhbs/hH8t7IoM OhLo7htFbx0usPwNCFSc4k/xlxwKFrxgO5npI31dOoD0X9Bxs9mz2dMTiAirvvwQm+ CIfJuelBMYfJQ== Date: Sat, 16 Apr 2022 12:18:40 +0100 From: Jonathan Cameron To: Andy Shevchenko Cc: Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij , Lars-Peter Clausen Subject: Re: [PATCH v1 1/1] iio: gyro: mpu3050: Make use of device properties Message-ID: <20220416121840.0a75d721@jic23-huawei> In-Reply-To: <20220413163004.84789-1-andriy.shevchenko@linux.intel.com> References: <20220413163004.84789-1-andriy.shevchenko@linux.intel.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; 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 Wed, 13 Apr 2022 19:30:04 +0300 Andy Shevchenko wrote: > Convert the module to be property provider agnostic and allow > it to be used on non-OF platforms. > > While at it, reuse temporary device pointer in the same function. > > Signed-off-by: Andy Shevchenko Applied. Thanks, Jonathan > --- > drivers/iio/gyro/mpu3050-core.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/iio/gyro/mpu3050-core.c b/drivers/iio/gyro/mpu3050-core.c > index ea387efab62d..a2dafdb64692 100644 > --- a/drivers/iio/gyro/mpu3050-core.c > +++ b/drivers/iio/gyro/mpu3050-core.c > @@ -26,6 +26,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -1050,6 +1051,7 @@ static const struct iio_trigger_ops mpu3050_trigger_ops = { > static int mpu3050_trigger_probe(struct iio_dev *indio_dev, int irq) > { > struct mpu3050 *mpu3050 = iio_priv(indio_dev); > + struct device *dev = mpu3050->dev; > unsigned long irq_trig; > int ret; > > @@ -1061,8 +1063,7 @@ static int mpu3050_trigger_probe(struct iio_dev *indio_dev, int irq) > return -ENOMEM; > > /* Check if IRQ is open drain */ > - if (of_property_read_bool(mpu3050->dev->of_node, "drive-open-drain")) > - mpu3050->irq_opendrain = true; > + mpu3050->irq_opendrain = device_property_read_bool(dev, "drive-open-drain"); > > irq_trig = irqd_get_trigger_type(irq_get_irq_data(irq)); > /* > @@ -1118,13 +1119,12 @@ static int mpu3050_trigger_probe(struct iio_dev *indio_dev, int irq) > mpu3050->trig->name, > mpu3050->trig); > if (ret) { > - dev_err(mpu3050->dev, > - "can't get IRQ %d, error %d\n", irq, ret); > + dev_err(dev, "can't get IRQ %d, error %d\n", irq, ret); > return ret; > } > > mpu3050->irq = irq; > - mpu3050->trig->dev.parent = mpu3050->dev; > + mpu3050->trig->dev.parent = dev; > mpu3050->trig->ops = &mpu3050_trigger_ops; > iio_trigger_set_drvdata(mpu3050->trig, indio_dev); >