Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1777461rwl; Thu, 30 Mar 2023 01:06:28 -0700 (PDT) X-Google-Smtp-Source: AKy350a/4sr8OKDkbwwuYFxsnsiPh3586bjPwqe2FJ/y2n2/CnOetp2QdQw17C32m8CwktvEPR4s X-Received: by 2002:a17:906:224e:b0:92c:fc0:b229 with SMTP id 14-20020a170906224e00b0092c0fc0b229mr1479139ejr.0.1680163588390; Thu, 30 Mar 2023 01:06:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680163588; cv=none; d=google.com; s=arc-20160816; b=E3uUR1NnOWYCMWhxSmlQ4KAMoPViQKEa/rQl8SiFovQ8Y6DVXbtBSavpecrn4+9I7V FAZkcMglUv7CR56xrh5G/Lo/cLiNJqigP+B6xKUBO2StR2ythv7ccHeZ6MbGR+tGcN3u 4ZZeKLT+GCGYi67zV4UdhFdlJsScGzX/jh9UKMjmZ2BASpYASgWiEokBbqOBUcycmQTK jhm9llx1YrrB/yNewPPtdq9zlY5yhN3tIM0qj6vHgDlDqnK6RxESazltkwboICoAER6y AH2aUzZNFZnUcDBX8R8jeqZZXjSLKnkhAwUYGpeRyQA2BFdddXy3y26zjEefoQKVF2Z+ GOtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=AlXibMxlWDb3fE7PPlx7SqRIaOU+iY/my4CtWS+AFz0=; b=WZo12xpO7SZ118wQK192Rd+fQPRTfO+LcZtoV7RulxEo3RCPiq6pGIGJeBZkjlGHoT RiY4UpV2djKBNcVISrgSin5kQnWRSNu7KkyuMXrAX086aAK2RkVCmMcJnFraWnPpKJDM NVJ632pOPqugNessKsGiNx9aFHKeRxVeYgSh1rurGxxePe7Dvs7KdsXf58EBpTNutHQs N5a78QOgA2J7XfecUsstC0Zi3i4e1j7Oa91UuQf9z77s4zdsJwQzrsMMG+czjZaLUkKC ljIqoyP5cmi0xSbEImqe44FWxrqkys6022IMIxQNnPhHHGdPV9myd5f0GRTn1wuFAlYE OfZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gOm82s6M; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt35-20020a1709072da300b0093cf8c96446si22189881ejc.686.2023.03.30.01.06.02; Thu, 30 Mar 2023 01:06:28 -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=@linaro.org header.s=google header.b=gOm82s6M; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230015AbjC3IFJ (ORCPT + 99 others); Thu, 30 Mar 2023 04:05:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230005AbjC3IFF (ORCPT ); Thu, 30 Mar 2023 04:05:05 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF9AD659E for ; Thu, 30 Mar 2023 01:04:56 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id k37so23500854lfv.0 for ; Thu, 30 Mar 2023 01:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680163495; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=AlXibMxlWDb3fE7PPlx7SqRIaOU+iY/my4CtWS+AFz0=; b=gOm82s6MR20hI+r3IB7/L5e+uq1Zz3OLh840E7iYyoP2gDecLH48lajqbgYV8NVJvN xPEboB8255TuCoxzCDS2+FESyUM8H0DhzpSgt6mSkF1+zD57sDtkfqqKjdz5imIVuC6f 7Du2uERLeJwYowtYMBIhB9Hcua+RgXPLS7WipJy2D7Lb3gVmOeNQ4r5787/YFt6FiewJ 0x1mjZQeTGeal2MrM9jN8pYGDKU7wrfJZNIizTJnKnAa3SNiPQ5NSgA+SkXVNpxh8rn+ jCOjqHT2gK8MX4yF5DZaiUk4FAGkQARmVJdKtMKnj2vzq9ClK5XtNHyzUvItu1Lj3z2o 3AyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680163495; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AlXibMxlWDb3fE7PPlx7SqRIaOU+iY/my4CtWS+AFz0=; b=aFUcn3TPCAqc8ZxAWvzZ/JnRoyXmBym7VVAu/f4Otbyyw9HxG+WyHh1Cw9+FNmytD2 bNlny8sdX53QKQJ0wjgw0eb+mYCXGEFDfN7WTeGRhArmUQ4ONsikxMW9Jwnl7NyGUR0C EnLrfBC+mT3A/vBoirFH3BdcxoZ9Uv810puBfQDCKsf9gxHHq7g8MYouknQ907W9Zgr9 UKy7xBJI+KEnDw3e4hg+WU7xNetLQ2seQTAvrYjO88Bpf8woE4dWDyQGkHjvfpSLYibZ 0jB8eCSjKfrQTlaHHmQyo3t+OJ5D+dWh7KB87aJja7smodns2CUCBSertHPt6P6lx0PI Pvgg== X-Gm-Message-State: AAQBX9dJZWudxHrepiuo6ODjJR7TO8yfTJHfNFVXmB5bTm7IoLrVj7ac Ddu1FZ3myWQgagkpxkMSEkQ+4Q== X-Received: by 2002:ac2:4db7:0:b0:4e8:3d0:84b4 with SMTP id h23-20020ac24db7000000b004e803d084b4mr1673498lfe.24.1680163495153; Thu, 30 Mar 2023 01:04:55 -0700 (PDT) Received: from [192.168.0.21] (78-11-189-27.static.ip.netia.com.pl. [78.11.189.27]) by smtp.gmail.com with ESMTPSA id q17-20020ac25151000000b004d5a6dcb94fsm5810324lfd.33.2023.03.30.01.04.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Mar 2023 01:04:54 -0700 (PDT) Message-ID: Date: Thu, 30 Mar 2023 10:04:53 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v6 5/5] mfd: max77541: Add ADI MAX77541/MAX77540 PMIC Support Content-Language: en-US To: Lee Jones , 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" 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> <20230329150605.GW2673958@google.com> From: Krzysztof Kozlowski In-Reply-To: <20230329150605.GW2673958@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, 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 29/03/2023 17:06, Lee Jones wrote: > 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. I agree. Especially that casting through ulong_t drops the const, so the cast back needs const which can be forgotten. The patch already makes here mistake! Best regards, Krzysztof