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 21929C001B0 for ; Tue, 15 Aug 2023 14:50:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237662AbjHOOuN (ORCPT ); Tue, 15 Aug 2023 10:50:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237683AbjHOOto (ORCPT ); Tue, 15 Aug 2023 10:49:44 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ED05C5; Tue, 15 Aug 2023 07:49:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1692110984; x=1723646984; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=U1a9LYcXm1tbEJKoK+HhtRRodOjMrQscpdZ+lCsnGVU=; b=kFX7c64dcz4PSglKl9O1wWIAZKacLrjaXWnohAQzNFPOuQSTHzANka1o XNLtB17+3Y+P8ddvpcdVM1xTE0xTD2DeOBlMDs1e2MFPc6M9eKorf9Viu GeAnVlks+GrtJgIkpmwOtWaLxQ3TF6PUwHXXXc9NV1/mQm3TZakxUqu5D leZkGLIeEQhZAK6RjxXmP/G/GeSqJmJI4vwqnYbw4+ToJryoB24oGIqxJ fixnnrk21D9aTF9JHiIfPlzJZgeJD/zeJ72+vaQEV+lW9CiPhrXkD1F8A bUI2iB3Cj1nGdPjWoA8NCbTWQcaiKIXpBNXkbkZWa+SH2aONDFVGf1exq Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10803"; a="362441216" X-IronPort-AV: E=Sophos;i="6.01,174,1684825200"; d="scan'208";a="362441216" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Aug 2023 07:49:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10803"; a="727397358" X-IronPort-AV: E=Sophos;i="6.01,174,1684825200"; d="scan'208";a="727397358" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga007.jf.intel.com with ESMTP; 15 Aug 2023 07:49:41 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qVvMZ-005wcD-0S; Tue, 15 Aug 2023 17:49:39 +0300 Date: Tue, 15 Aug 2023 17:49:38 +0300 From: Andy Shevchenko To: Biju Das Cc: Jonathan Cameron , Lars-Peter Clausen , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Peter Rosin , Krzysztof =?utf-8?Q?Ha=C5=82asa?= , linux-iio@vger.kernel.org, Geert Uytterhoeven , linux-renesas-soc@vger.kernel.org Subject: Re: [PATCH] iio: chemical: atlas-sensor: Convert enum->pointer for data in the match tables Message-ID: References: <20230812171330.226247-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230812171330.226247-1-biju.das.jz@bp.renesas.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Sat, Aug 12, 2023 at 06:13:30PM +0100, Biju Das wrote: > Convert enum->pointer for data in the match tables, so that > device_get_match_data() can do match against OF/ACPI/I2C tables, once i2c > bus type match support added to it. > > Replace enum->struct *atlas_device for data in the match table. Simplify > the probe() by replacing device_get_match_data() and ID lookup for > retrieving data by i2c_get_match_data(). > > While at it, add const qualifier to struct atlas_device and drop unused > id variable from probe(). Same comments for id variable removal. With that addressed and below remark, Reviewed-by: Andy Shevchenko ... > static const struct of_device_id atlas_dt_ids[] = { > - { .compatible = "atlas,ph-sm", .data = (void *)ATLAS_PH_SM, }, > - { .compatible = "atlas,ec-sm", .data = (void *)ATLAS_EC_SM, }, > - { .compatible = "atlas,orp-sm", .data = (void *)ATLAS_ORP_SM, }, > - { .compatible = "atlas,do-sm", .data = (void *)ATLAS_DO_SM, }, > - { .compatible = "atlas,rtd-sm", .data = (void *)ATLAS_RTD_SM, }, > + { .compatible = "atlas,ph-sm", .data = &atlas_devices[ATLAS_PH_SM], }, > + { .compatible = "atlas,ec-sm", .data = &atlas_devices[ATLAS_EC_SM], }, > + { .compatible = "atlas,orp-sm", .data = &atlas_devices[ATLAS_ORP_SM], }, > + { .compatible = "atlas,do-sm", .data = &atlas_devices[ATLAS_DO_SM], }, > + { .compatible = "atlas,rtd-sm", .data = &atlas_devices[ATLAS_RTD_SM], }, Now drop inner trailing commas. > { } > }; -- With Best Regards, Andy Shevchenko