Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7474987rwl; Tue, 10 Jan 2023 01:01:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXtaQkBF3su5H/9EtcajpUDBjeMZAVlEHHhq0BG49H/o9SQiEKzOMAPUAy15b3Sxr9AKO9iW X-Received: by 2002:a17:90b:17c2:b0:219:b034:941c with SMTP id me2-20020a17090b17c200b00219b034941cmr68654486pjb.18.1673341299377; Tue, 10 Jan 2023 01:01:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673341299; cv=none; d=google.com; s=arc-20160816; b=UYOE6LzPCiJ5rWjvk4WePRY2x2hiIchKoTTFHw+GiPdcDJ3Y9mmbErtUn/02vAHhh+ 9jqaSrutOYN9eyBPRwTWmBRCz8Hd3u1B6GSlS1Kvs8tObJ4zp9q87TcuNivtwPINBH2/ j5TIHl+PqBR+kXSbybVupnnPt6pdPDEKlkZABqBwa+opGKzuxwqd5HKRchlyEzQW0RUt s7LaFTCC3nhiUiT6EwBsAdLD3Ut8bA2+KdZKwusFvEM6Qau/aAR4eEFTZoxMzBil9191 Uvqvjjfy1sVkDOrOYRnxQN7ONBI2VG/eAtTK3SawLOxFnCc1fZDvkUsR4VKZIJ+nvd1p xseg== 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=iY2kNKoTIXZn2gSTCybP9yJzCdsfQZ3WA/pnwKJAnKY=; b=AbN8HESH6g7P8HMFP4H2y54fID/TgwhnAkKLNPUwNhxCFr9/TJ9MkvQ9nQ3qkHdbFo XAx5ycsV3K7wsIXCnC4JYJlbfa0v9uDbq0zp8EuR40sXxC8ZWii/hHQVmJLqCVRugCzK RdanhSLtJuuYgaHohUDbMWB2/lMCTDngui65bl3phChXQqFROta0XaGP/EiJEezSYhjY fs7sjqX8G/1Echr6makvO+QXB1gljHqwu6PNzBHKSegtOx+owDo6oRZyKNUAe6UIPUGf bEKMU8G5lR998ADa1PsZKXt6FKut6gVPg0n+IH9fPxV1y86zUwLNx8u8SNQ4YS/Eq2d+ rUug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Uj3oQaHj; 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 h19-20020a17090ac39300b00212f7abe85csi14390324pjt.41.2023.01.10.01.01.32; Tue, 10 Jan 2023 01:01:39 -0800 (PST) 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=Uj3oQaHj; 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 S237709AbjAJIgF (ORCPT + 53 others); Tue, 10 Jan 2023 03:36:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237653AbjAJIfq (ORCPT ); Tue, 10 Jan 2023 03:35:46 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 306314F13E for ; Tue, 10 Jan 2023 00:35:36 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id g19-20020a05600c4ed300b003d9eb1dbc0aso6243321wmq.3 for ; Tue, 10 Jan 2023 00:35:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=iY2kNKoTIXZn2gSTCybP9yJzCdsfQZ3WA/pnwKJAnKY=; b=Uj3oQaHjeYYpzutkftegGDOi1+X0Xm8kuiYk6QJu4Z41fDjcNYu2LJ0pmpa0DtZ1mo zey0AQOqYno52448CqwFWaRPqY0/tpe0uY2b4f6SagaB1myNpvcNt+HlVR5RwBcnMX1z HQ33A1FRZz/lz35GAe2t29DqsmXMJM8h3BSBqbZd0Ozsi0PfHWGXus9NP8rn3szflW9w Np3Ka1VHiQzVaBWP4EVqHrr87eVevHNhhHQMa/VuJJkyk4BoIFTZ9TjLxGndb174vmNV HBbJzvoYI8BIULUu7Kz9wZhQQ15yMEKAjFjgN68/taR84EzOTC4rj1g4ZH9Gbb5RsU1I 3Rhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=iY2kNKoTIXZn2gSTCybP9yJzCdsfQZ3WA/pnwKJAnKY=; b=pX25vIuBVJH04K4oGXkTUS3TZyQKw5TiUSRrFB4C5KsIzvIHURHWG/VzXuQ/eIAO05 4txykjZb0Ds05yk0qES3p6MnpnbPCUk7L7DGfY6YZxMjZTCuvhA+yyVCEwtDYhY9JjT7 0WQglqixY2gC95nQIYxkZ3Ej50KwBBKDf30/DEl44GH9m1+jNUGxv0wyJuQ7TuIq+0eX tz3so1tMX1WWLG99/xS1Qpzq+yBb1MtjrHoBa9Qj6oZwDeFBpJI0dNOxfx2P62iyBBpC e4rQmv6Ozgx760TayJvedPD1wuv2SZ08hXhz+F6pmR+gd0aLacuSunMHQ7GHS+5aN/mn 1X1Q== X-Gm-Message-State: AFqh2kqqTxiVRlZbvjWwuH7qQqnAPYNlxB4duLtahMUv25zWZ7fAGWaO z9TYlFzRfW3fRyu0d++SDMkzKw== X-Received: by 2002:a05:600c:4f12:b0:3d9:f492:f25f with SMTP id l18-20020a05600c4f1200b003d9f492f25fmr3521200wmq.16.1673339734712; Tue, 10 Jan 2023 00:35:34 -0800 (PST) Received: from [192.168.1.109] ([178.197.216.144]) by smtp.gmail.com with ESMTPSA id i13-20020adffdcd000000b002a91572638csm10334677wrs.75.2023.01.10.00.35.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Jan 2023 00:35:33 -0800 (PST) Message-ID: Date: Tue, 10 Jan 2023 09:35:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v1 1/6] i2c: hpe: Add GXP SoC I2C Controller Content-Language: en-US To: "Hawkins, Nick" Cc: "Verdun, Jean-Marie" , "robh+dt@kernel.org" , "krzysztof.kozlowski+dt@linaro.org" , "lee@kernel.org" , "linux@armlinux.org.uk" , "linux-i2c@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" References: <20221216183532.78933-1-nick.hawkins@hpe.com> <20221216183532.78933-2-nick.hawkins@hpe.com> <832510cf-0a1d-35cb-8754-7d9c9e94b0a6@linaro.org> <1F4A96B7-F90D-401D-93D8-A14CD8F4E0B7@hpe.com> From: Krzysztof Kozlowski In-Reply-To: <1F4A96B7-F90D-401D-93D8-A14CD8F4E0B7@hpe.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,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 09/01/2023 21:23, Hawkins, Nick wrote: >>> + GFP_KERNEL); >>> + if (!drvdata) >>> + return -ENOMEM; >>> + >>> + platform_set_drvdata(pdev, drvdata); >>> + drvdata->dev = &pdev->dev; >>> + init_completion(&drvdata->completion); >>> + >>> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); >>> + drvdata->base = devm_ioremap_resource(&pdev->dev, res); > >> It's one call, not two. Use the respective helper. > > Greetings Krzysztof, > > Thank you for the feedback. I am in the process of applying your recommended > changes but do have a question on this comment. > > I can replace these two lines with: > drvdata->base = devm_platform_ioremap_resource(pdev, 0); > > However, I still have a need for the resource "res" here to determine the physical > address of the device here: > >>> + if (IS_ERR(drvdata->base)) >>> + return PTR_ERR(drvdata->base); >>> + >>> + drvdata->engine = (res->start & 0xf00) >> 8; >>> + pr_info("%s: i2c engine%d\n", __func__, drvdata->engine); Entire pr_info must be gone, so you do not need res anymore. You should not print any addresses. Unless drvdata->engine is used further? In such case you have function just few lines above the one you mentioned, don't you? > > Hence at some point I believe I will still need to call the "platform_get_resource" > function to accomplish this. Is this acceptable or perhaps you have another > suggestion? > > One alternative I thought of was including a property in the device tree node > That specifies which i2c engine this is: hpe,gxp-engine = <1>. Best regards, Krzysztof