Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp779017rwl; Wed, 29 Mar 2023 08:20:53 -0700 (PDT) X-Google-Smtp-Source: AKy350Z6BJEaj68QCo9IUPhoVfEE/UeBqy3JbP2+eYgB32IB1g/pkGJ1PMiOUsHf9UmnshQdyw7e X-Received: by 2002:a17:906:8547:b0:946:bd15:b13f with SMTP id h7-20020a170906854700b00946bd15b13fmr6616139ejy.44.1680103253250; Wed, 29 Mar 2023 08:20:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680103253; cv=none; d=google.com; s=arc-20160816; b=GAJNMYJbb88FKNL0+3HA0c8eRF2ycaiMidHyZ1yg4D3NN9E6RNnXlWp4CVW1NpAD/e XiYiSObY/lbL7Okv5Loln3I6mg7jahKy7hE3sYB0xYWYtj8dRVa4EIEtqhyROetvRIeh n5ehWA+jy90jdLU6Gpdt9wfdOMq4cKmqS6cblhH3QLpDZk0L+dP5wb5coL+Jt/junv/1 aFnqpVAMZRDNVFK4vUJ2/Um2uFFH2m37h1DWLhhNX1ODEnjGenfIaBKTY8GviYT37Oze KkAdMj23Lm9Om9MApfsaT1v0PJ3ad+jpDNFM/jIMbR4CFctjMhrKCa/S1cxB5qYYVSO7 xaxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=KJtNsTzeEwmtaFosPMgWES1daabjXJ4G/JpyXAnsdfk=; b=af38Iljlr6CrsMu+/B+VWcl22iPfgXmMz+LzZnnuA+2BXFm/FRHxi/kn2LaJwHgGrN yPKUAYq4jvjNZ++NCPDhwJNnXij8HQjsKTkNQmYDLHz1TzuB9zgMJRGZUyFnK7IEyvyE YTMbMgVB1tD1pBtRIG5DymnTaOXSBMMTLCEY5Q79iaHr380xHWcRipeDkhBnmedKinyr C0D/pgT4LbOoMflaBVvBMwKa1V9h1uz85irlgX4i/mMqPI39xqg904Ek2GLPaLL1RZT9 RGucukm9DLaHN0KvQ/2hIfwaYCesRKaYPexX9Gp+yaX1kFXWLZ5tigOB0pD6y8niCUVu 53Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=T3L0kzPO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y8-20020a17090629c800b00924578a4ff2si16657224eje.64.2023.03.29.08.20.28; Wed, 29 Mar 2023 08:20:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=T3L0kzPO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230331AbjC2PGX (ORCPT + 99 others); Wed, 29 Mar 2023 11:06:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbjC2PGV (ORCPT ); Wed, 29 Mar 2023 11:06:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCFE93C1E; Wed, 29 Mar 2023 08:06:14 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 67A1D61D6D; Wed, 29 Mar 2023 15:06:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28642C433EF; Wed, 29 Mar 2023 15:06:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680102373; bh=5vjINNeKe6LiQmi33iXc8oeTqq9Ju4aWWGikWY46LX0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=T3L0kzPOYcISf2hQru30jp3nqSOsML9n7nxJXTRKCsmM325BTEgdUgGTTdKXq9ACB nejfaSLtVvX0PbrYWO3EZGE3OcPxbSC7CELGE/dOupr44RQRqSJ63N0dKvQBFc8AZ9 b6UQs8mDb5LVd1h4m9soDbPGAEOE+aSuYtraelvJIBePUTNzz/tm2oErLly1dtVzfV EAxsdJ6aijQG5BHYFX0mS4PpBYKtg7T8Uc/+VolQnVjV/rUc1wBMqtyQCYc6NpOA0d sb2R1/supusKN+77bFDe7s+PQT7rDlTPFRRSmEs7zPZKeNR/4bHH1TwGUtTlSCuvLJ Itni8mXraPbfg== Date: Wed, 29 Mar 2023 16:06:05 +0100 From: Lee Jones To: Andy Shevchenko Cc: "Sahin, Okan" , Rob Herring , Krzysztof Kozlowski , Liam Girdwood , Mark Brown , Jonathan Cameron , Lars-Peter Clausen , Cosmin Tanislav , Stephen Boyd , Caleb Connolly , Lad Prabhakar , "Bolboaca, Ramona" , ChiYuan Huang , "Tilki, Ibrahim" , William Breathitt Gray , Arnd Bergmann , ChiaEn Wu , Haibo Chen , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-iio@vger.kernel.org" Subject: Re: [PATCH v6 5/5] mfd: max77541: Add ADI MAX77541/MAX77540 PMIC Support Message-ID: <20230329150605.GW2673958@google.com> References: <20230307112835.81886-1-okan.sahin@analog.com> <20230307112835.81886-6-okan.sahin@analog.com> <20230315175223.GI9667@google.com> <20230315175257.GJ9667@google.com> <20230329143615.GS2673958@google.com> <20230329145636.GV2673958@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230329145636.GV2673958@google.com> X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 29 Mar 2023, Lee Jones wrote: > On Wed, 29 Mar 2023, Andy Shevchenko wrote: > > > On Wed, Mar 29, 2023 at 03:36:15PM +0100, Lee Jones wrote: > > > On Tue, 28 Mar 2023, Sahin, Okan wrote: > > > > >On Wed, 15 Mar 2023, Lee Jones wrote: > > > > >> On Tue, 07 Mar 2023, Okan Sahin wrote: > > > > ... > > > > > > +static const struct i2c_device_id max77541_i2c_id[] = { > > > > + { "max77540", (kernel_ulong_t)&chip[MAX77540] }, > > > > + { "max77541", (kernel_ulong_t)&chip[MAX77541] }, > > > > > > Just 'MAX77540' is fine. > > > > I tend to disagree. > > > > There is an error prone approach esp. when we talk with some functions > > that unifies OF/ACPI driver data retrieval with legacy ID tables. > > In such a case the 0 from enum is hard to distinguish from NULL when > > the driver data is not set or not found. On top of that the simple integer > > in the legacy driver data will require additional code to be added in > > the ->probe(). > > Use a !0 enum? > > The extra handling is expected and normal. I've always disliked mixing platform initialisation strategies. Passing pointers to MFD structs through I2C/Device Tree registration opens the doors to all sorts of funky interlaced nonsense. Pass the device ID and then match in C-code please. -- Lee Jones [李琼斯]