Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1709207iog; Tue, 14 Jun 2022 11:26:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzatHQlnl746mp45j623Qd+HocVM31OiyK+gJ8CTFkYFJZdKGVxcc0TBibcn0KR9t6XyQar X-Received: by 2002:a05:6a00:2286:b0:51c:48b7:a445 with SMTP id f6-20020a056a00228600b0051c48b7a445mr5799503pfe.62.1655231170771; Tue, 14 Jun 2022 11:26:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655231170; cv=none; d=google.com; s=arc-20160816; b=jzbl780Ksxvf3kgB8FZSqUwj9yVcmXd4uiiKoaC9/Om1f8f8ukiIq2qgZHaVCMyrXI fo4gWFVI1wcpwU6gZjjrK28YIV6ncT6MTSQ+J7FS5kiYVSj/YnG+2AfLgOFZpUfjmRfB +rFIfCY9+Td6nDxtGSIB8W6Z+7T5CU2VXTZjLaVKWXdY3pMS61cxJKc8pzui7pQbxf2T XdA5Gs1ZeREFqiKhorAoT6SbgK8Rl/yEPsg99OL3o7Px96HinOEYFhQz/jB7gZF/Igkv cxIf4hFJR1AUcpSUHr7NbSf6UGPj5mBf2Ty6cdZVxkXtCExaKSERHtimn4HgTTun5uKp frpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ZsjTA9iJIzTxX4ygR8FdKM9wnHJIUgreAx1BZ2osk+k=; b=IQnPlbo2Nu1gVyieA+2P32Lbm8x27/VqHggrm62DbIjE0nC9WzxBqYd64tWelKzwq5 T3Lz4kNP7WSVRdFalkxFBt7VKjEJi5ASxKzjdfA9Id2oMdV8tIXEbtarBhhrUCLlCuQI BkKulgj+IABr4SxGpAUxlQvyeSxhE9/d2mgQVqrVy6wvSmEdX/KRDeFdm4fPPNj5kp0n dvq0t0baZOJHBgXZcrvxcEmCCGF26ZFSMajnZe1qYJj9l47hC+VPXDY9h0758AuLKdN3 mSdsqJJ6VF1k1lZYDs4sNu7epdO5k3lWqFhj/z8JMObXHv/h4Tm4za94uccydZAOyjiG XgnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=elkEMMAy; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nl8-20020a17090b384800b001e09593dc80si1413283pjb.51.2022.06.14.11.25.57; Tue, 14 Jun 2022 11:26:10 -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=@chromium.org header.s=google header.b=elkEMMAy; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235143AbiFNSN7 (ORCPT + 99 others); Tue, 14 Jun 2022 14:13:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229902AbiFNSN6 (ORCPT ); Tue, 14 Jun 2022 14:13:58 -0400 Received: from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com [IPv6:2607:f8b0:4864:20::1130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4002919C32 for ; Tue, 14 Jun 2022 11:13:57 -0700 (PDT) Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-30c143c41e5so38456087b3.3 for ; Tue, 14 Jun 2022 11:13:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZsjTA9iJIzTxX4ygR8FdKM9wnHJIUgreAx1BZ2osk+k=; b=elkEMMAy3wPQwGf1ROmnn/4Isu60xOrk5kwhUf9POtxNbXra9m+VOIyaYdDcP+3CU3 2JT5ARrP4xwLtPX0Ds74mSJUDU0WpEwRhBDquEnA4hNv+/G/6Q6UFzYcWShmefjq8AjX gz+FlbByjs1p+vyfBLAp58Tc0jFjVzOn1TINg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZsjTA9iJIzTxX4ygR8FdKM9wnHJIUgreAx1BZ2osk+k=; b=QmT8jfjpuPvBWVyocAyt4RBgizWIHIs9QJvIg3NjHya9ZVtN2IMKaSzdRpTbgKKLUQ Ur1Lbxuc+s4M3WmTxwNBReNwWdPozWzgWtSeMYgYTVnerWGzOL8q1CPrjkXN5WeriZH9 9pRcGlyEfZVJp2Y4B5LsfezSjg+Y/a1vV57eL8hHrklPS2FGOMwXUvLBAOZs6IE3kAZp YCKyqfU1ycCzI7HrC/u7wPHyYx4KgHCYk7zIx8vIx9U+LLE6XrtoH0WD0yQ+wAD8osN/ KtpUgN4E0lGov8VjokWJo/t9o8/F45SPqpBFF8ap9hAFw0RO10FI1NaSrUMJV8heHbL5 k0tg== X-Gm-Message-State: AJIora9d/1Ef1i+tLWDOAMpSw3tVkFCkSlPg/pRYmjkrwmTVix+/V9+t 8Fkf7O4JmI8Ev5jM+sd1ztw+X8wRG24u4yHPh7G68w== X-Received: by 2002:a81:fd1:0:b0:30f:f98b:4957 with SMTP id 200-20020a810fd1000000b0030ff98b4957mr7329858ywp.350.1655230436484; Tue, 14 Jun 2022 11:13:56 -0700 (PDT) MIME-Version: 1.0 References: <20220609181106.3695103-1-pmalani@chromium.org> <20220609181106.3695103-6-pmalani@chromium.org> In-Reply-To: From: Prashant Malani Date: Tue, 14 Jun 2022 11:13:45 -0700 Message-ID: Subject: Re: [PATCH v2 5/7] drm/bridge: anx7625: Register number of Type C switches To: AngeloGioacchino Del Regno Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, heikki.krogerus@linux.intel.com, Andrzej Hajda , Neil Armstrong , David Airlie , "open list:DRM DRIVERS" , Laurent Pinchart , Krzysztof Kozlowski , Sam Ravnborg , Jernej Skrabec , Tzung-Bi Shih , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Thomas Zimmermann , =?UTF-8?B?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Jonas Karlman , swboyd@chromium.org, Pin-Yen Lin , Rob Herring , Maxime Ripard , Hsin-Yi Wang , Xin Ji , Greg Kroah-Hartman , Robert Foss , =?UTF-8?B?Sm9zw6kgRXhww7NzaXRv?= Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Tue, Jun 14, 2022 at 1:22 AM AngeloGioacchino Del Regno wrote: > > Il 09/06/22 20:09, Prashant Malani ha scritto: > > Parse the "switches" node, if available, and count and store the number > > of Type-C switches within it. Since we currently don't do anything with > > this info, no functional changes are expected from this change. > > > > This patch sets a foundation for the actual registering of Type-C > > switches with the Type-C connector class framework. > > > > Signed-off-by: Prashant Malani > > --- > > > > Changes since v1: > > - No changes. > > > > drivers/gpu/drm/bridge/analogix/anx7625.c | 20 ++++++++++++++++++++ > > drivers/gpu/drm/bridge/analogix/anx7625.h | 1 + > > 2 files changed, 21 insertions(+) > > > > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c > > index 53a5da6c49dd..07ed44c6b839 100644 > > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c > > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c > > @@ -2581,6 +2581,22 @@ static void anx7625_runtime_disable(void *data) > > pm_runtime_disable(data); > > } > > > > +static int anx7625_register_typec_switches(struct device *device, struct anx7625_data *ctx) > > +{ > > + struct device_node *of = NULL; > > + int ret = 0; > > + > > + of = of_get_child_by_name(device->of_node, "switches"); > > + if (!of) > > + return -ENODEV; > > + > > + ctx->num_typec_switches = of_get_child_count(of); > > + if (ctx->num_typec_switches <= 0) > > + return -ENODEV; > > + > > + return ret; > > You aren't using the `ret` variable for anything other than returning zero: > remove it and simply return 0 here. The very next patch does use it, but sure I'll remove it from here and introduce it in v6. > > > +} > > + > > static int anx7625_i2c_probe(struct i2c_client *client, > > const struct i2c_device_id *id) > > { > > @@ -2686,6 +2702,10 @@ static int anx7625_i2c_probe(struct i2c_client *client, > > if (platform->pdata.intp_irq) > > queue_work(platform->workqueue, &platform->work); > > > > + ret = anx7625_register_typec_switches(dev, platform); > > + if (ret) > > + dev_info(dev, "Didn't register Type C switches, err: %d\n", ret); > > Type-C switches are optional for this driver and this will print a sort of error > on boards that are *not* declaring any switches on purpose (because perhaps they > don't have any, or for any other reason). > > Even though this is a dev_info and not a dev_err, it's still printing an alarming > (and useless, in the aforementioned case) message. I'll go ahead and convert this to dev_warn, but only trigger if there is an error other than ENODEV. > > Please fix this. > > Regards, > Angelo >