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 0CF98C71153 for ; Mon, 28 Aug 2023 11:44:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232179AbjH1Lni (ORCPT ); Mon, 28 Aug 2023 07:43:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232530AbjH1LnL (ORCPT ); Mon, 28 Aug 2023 07:43:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E477FE7; Mon, 28 Aug 2023 04:43:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 76E7B6140C; Mon, 28 Aug 2023 11:43:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 676C2C433CC; Mon, 28 Aug 2023 11:43:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693222986; bh=72TztgUYNH11IGNCSOKuN1rbP+ed/poncefHEK1ZlE0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=doDGZ3wiO4uuyKpoRYrvbiz4DAEiBNJLIB7Zx/3hJad6559ugCD0Iak3sK4Z4c8vf MEDgnit+9GKyTiFSHmeLp9pIupuOKyDaPcbjf2af+ync33cPSomkMB87B9NwFresRX 3xon8JBcqcAT7FeEZMTc5EZ9SDODkR9ao6s0/BvobV5pSsjjxoDNhzgmGSiEX1uOWy QRMLp/ZgUmw1rYNDZwsjisfDH8jNewc3ZhLQTsuIybvjtwBZvGHhoImUTbByOa0jum efPYwT2krD//HSkKZyRGOhvKzdyV62nt5gk4iXiziOHzNkymoYc0vWDIpJTu75MyVB s0Z1L4gDZshbQ== Date: Mon, 28 Aug 2023 12:43:25 +0100 From: Jonathan Cameron To: Biju Das Cc: Lars-Peter Clausen , Uwe =?UTF-8?B?S2xlaW5lLUvDtm5p?= =?UTF-8?B?Zw==?= , Andy Shevchenko , linux-iio@vger.kernel.org, Geert Uytterhoeven , Prabhakar Mahadev Lad , linux-renesas-soc@vger.kernel.org Subject: Re: [PATCH v2] iio: chemical: atlas-ezo-sensor: Simplify probe() Message-ID: <20230828124325.44589f84@jic23-huawei> In-Reply-To: <20230818183128.334233-1-biju.das.jz@bp.renesas.com> References: <20230818183128.334233-1-biju.das.jz@bp.renesas.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; 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 Fri, 18 Aug 2023 19:31:28 +0100 Biju Das wrote: > Simplify the probe() by replacing device_get_match_data() and ID lookup > match by i2c_get_match_data() as we have similar I2C and DT-based matching > table. > > Signed-off-by: Biju Das > Reviewed-by: Andy Shevchenko Applied. Thanks, J > --- > v1->v2: > * Dropped the sentence for removing id from commit description. > * Added Rb tag from Andy. > --- > drivers/iio/chemical/atlas-ezo-sensor.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/drivers/iio/chemical/atlas-ezo-sensor.c b/drivers/iio/chemical/atlas-ezo-sensor.c > index 8fc926a2d33b..761a853a4d17 100644 > --- a/drivers/iio/chemical/atlas-ezo-sensor.c > +++ b/drivers/iio/chemical/atlas-ezo-sensor.c > @@ -203,7 +203,6 @@ MODULE_DEVICE_TABLE(of, atlas_ezo_dt_ids); > > static int atlas_ezo_probe(struct i2c_client *client) > { > - const struct i2c_device_id *id = i2c_client_get_device_id(client); > const struct atlas_ezo_device *chip; > struct atlas_ezo_data *data; > struct iio_dev *indio_dev; > @@ -212,10 +211,7 @@ static int atlas_ezo_probe(struct i2c_client *client) > if (!indio_dev) > return -ENOMEM; > > - if (dev_fwnode(&client->dev)) > - chip = device_get_match_data(&client->dev); > - else > - chip = (const struct atlas_ezo_device *)id->driver_data; > + chip = i2c_get_match_data(client); > if (!chip) > return -EINVAL; >