[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ef3933a8-88c2-f19f-97df-3498f54b9a4f@collabora.com>
Date: Tue, 14 Jun 2022 10:22:42 +0200
From: AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>
To: Prashant Malani <pmalani@...omium.org>,
linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Cc: heikki.krogerus@...ux.intel.com,
Andrzej Hajda <andrzej.hajda@...el.com>,
Neil Armstrong <narmstrong@...libre.com>,
David Airlie <airlied@...ux.ie>,
"open list:DRM DRIVERS" <dri-devel@...ts.freedesktop.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Sam Ravnborg <sam@...nborg.org>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Tzung-Bi Shih <tzungbi@...gle.com>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@...r.kernel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
Nícolas F. R. A. Prado
<nfraprado@...labora.com>, Jonas Karlman <jonas@...boo.se>,
swboyd@...omium.org, Pin-Yen Lin <treapking@...omium.org>,
Rob Herring <robh+dt@...nel.org>,
Maxime Ripard <maxime@...no.tech>,
Hsin-Yi Wang <hsinyi@...omium.org>,
Xin Ji <xji@...logixsemi.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Robert Foss <robert.foss@...aro.org>,
José Expósito <jose.exposito89@...il.com>
Subject: Re: [PATCH v2 5/7] drm/bridge: anx7625: Register number of Type C
switches
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 <pmalani@...omium.org>
> ---
>
> 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.
> +}
> +
> 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.
Please fix this.
Regards,
Angelo
Powered by blists - more mailing lists