From patchwork Wed Nov 16 13:03:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13045193 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 78778C43217 for ; Wed, 16 Nov 2022 13:03:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3155410E0F1; Wed, 16 Nov 2022 13:03:39 +0000 (UTC) Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5ACD710E0F1 for ; Wed, 16 Nov 2022 13:03:36 +0000 (UTC) Received: by mail-lj1-x22d.google.com with SMTP id x21so21721887ljg.10 for ; Wed, 16 Nov 2022 05:03:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=JylTANdU+MtnPx7R0U874tZZVITnr1u0HsmnJdn+AyY=; b=dddiZF0v13cgng46+PJjInrIBo9snGjnjymRxUgzSF5VH+mZyJpMByeuvXl39iuyx0 Sn0EQqR55++pjD8hUrzNh4wGNbWqNnGuEqgbeRRXl5fxjqkgjiqpO5aixY9VjPzoFozy lbQX1J7/29ZWMBKx077j+lV0hhXfoXf+rPlWbFfgxeY1qu97wwQyyLs1srQxY+/oTAAb Rt6LK5WSuTBp6LIYHbUcX17WxDH/jGBLtTKjx+A2gf2K5qEbmQObSGdTbbUYnNoQMbJH LfoTrG4KGwY0fNBCnMkgHCK7EZrrMflSZjjffIA63qjvXNDJ1LVNeNXmjLO5lUKFJE/Z mIvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=JylTANdU+MtnPx7R0U874tZZVITnr1u0HsmnJdn+AyY=; b=XPVXXl2v9VRPFOiy47m2gdKxWGqC2iNDFCy8dfoaBXJfqT8Zfh9V1766J7qXaQKgvG 5sU4WJ8VcFWfyJq1QUFLOs/cuar1IqdnuyqaV7B+9PnyIVkdzcvjhxDXadLMNeI6ZHna vE1m3TUKhEXYkT2Ljm0fFYklcAmSuYTKe56m6JJ5AbHsVWsgNPRJr1iFW8Dr4EI9kseE 0vZJ2Fxrs10AqfBvOFCkDcxjygD4HsYoWIW3kAt4TbgnPCKLZJ1vq+UPOa7C2JdwH6GB oXHgVQYjdruG9FlPQNHSX4h2oSaiOoXPevakY5zMuNP+UBQXdkjXV3b5Q4Z9yia0Tnut UBVg== X-Gm-Message-State: ANoB5pnocKR65DvtJjCpVj3V5pfEbrwpw65KQ6RsAPgql1aZNz7qgkBG GYy+pog5CUygN7o3aUlua6w= X-Google-Smtp-Source: AA0mqf6mYKQrD6tlA/nhsWmrS1ZVB5HKZrDM2mPsOQi7w/xcQPkxYVW0O+bEEcsE9+moP5hOhsdRXA== X-Received: by 2002:a2e:b8c5:0:b0:277:8144:2eb6 with SMTP id s5-20020a2eb8c5000000b0027781442eb6mr8247830ljp.45.1668603814464; Wed, 16 Nov 2022 05:03:34 -0800 (PST) Received: from dc75zzyyyyyyyyyyyyydt-3.rev.dnainternet.fi (dc75zzyyyyyyyyyyyyydt-3.rev.dnainternet.fi. [2001:14ba:16f3:4a00::7]) by smtp.gmail.com with ESMTPSA id u5-20020a05651c130500b002773a9b5898sm3010709lja.138.2022.11.16.05.03.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 05:03:33 -0800 (PST) Date: Wed, 16 Nov 2022 15:03:28 +0200 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Subject: [PATCH RESEND v4 1/2] gpu: drm: sii902x: Use devm_regulator_bulk_get_enable() Message-ID: <3f0ffbc27e6bcc208d32eb3bb94979a8ab28265f.1668602942.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , Jonas Karlman , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jernej Skrabec , Robert Foss , Andrzej Hajda , Laurent Pinchart Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Simplify using devm_regulator_bulk_get_enable() Signed-off-by: Matti Vaittinen Acked-by: Robert Foss --- I am doing a clean-up for my local git and encountered this one. Respinning as it seems this one fell through the cracks. --- drivers/gpu/drm/bridge/sii902x.c | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c index 878fb7d3732b..f6e8b401069b 100644 --- a/drivers/gpu/drm/bridge/sii902x.c +++ b/drivers/gpu/drm/bridge/sii902x.c @@ -171,7 +171,6 @@ struct sii902x { struct drm_connector connector; struct gpio_desc *reset_gpio; struct i2c_mux_core *i2cmux; - struct regulator_bulk_data supplies[2]; bool sink_is_hdmi; /* * Mutex protects audio and video functions from interfering @@ -1072,6 +1071,7 @@ static int sii902x_probe(struct i2c_client *client, struct device *dev = &client->dev; struct device_node *endpoint; struct sii902x *sii902x; + static const char * const supplies[] = {"iovcc", "cvcc12"}; int ret; ret = i2c_check_functionality(client->adapter, @@ -1122,27 +1122,11 @@ static int sii902x_probe(struct i2c_client *client, mutex_init(&sii902x->mutex); - sii902x->supplies[0].supply = "iovcc"; - sii902x->supplies[1].supply = "cvcc12"; - ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(sii902x->supplies), - sii902x->supplies); + ret = devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(supplies), supplies); if (ret < 0) - return ret; - - ret = regulator_bulk_enable(ARRAY_SIZE(sii902x->supplies), - sii902x->supplies); - if (ret < 0) { - dev_err_probe(dev, ret, "Failed to enable supplies"); - return ret; - } + return dev_err_probe(dev, ret, "Failed to enable supplies"); - ret = sii902x_init(sii902x); - if (ret < 0) { - regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies), - sii902x->supplies); - } - - return ret; + return sii902x_init(sii902x); } static void sii902x_remove(struct i2c_client *client) @@ -1152,8 +1136,6 @@ static void sii902x_remove(struct i2c_client *client) i2c_mux_del_adapters(sii902x->i2cmux); drm_bridge_remove(&sii902x->bridge); - regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies), - sii902x->supplies); } static const struct of_device_id sii902x_dt_ids[] = { From patchwork Wed Nov 16 13:03:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13045194 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EDF62C433FE for ; Wed, 16 Nov 2022 13:04:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 13F5910E167; Wed, 16 Nov 2022 13:04:03 +0000 (UTC) Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 588F410E167 for ; Wed, 16 Nov 2022 13:04:00 +0000 (UTC) Received: by mail-lf1-x12d.google.com with SMTP id b3so29382066lfv.2 for ; Wed, 16 Nov 2022 05:04:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=/w2U0GiGwFFrflmNCFpCFLaMnMdqbHDas4my61VJ3H4=; b=KAgIfzEgdBLkeRinXDVjGiOgDz4zxSP/Q12JRlfv9kc3Z0v1GoUvkrvMdg61Aye5RF TzgwQMoR19i2nvfMfobkJVN2k2PS8K7zB7qRjke7MIHjC325iSFR6fcT1OZOg6XqS+6q 4UbQn7/DqGiydfHGtx6F9lW/VEz0B5KI+bf5I3OniXwsnHcI/QxY4PLrgXhKLHFzJXGD OFtQbFrp+uvaLYFxXYJ6TAmoz78B1tV58ztVPwWKLQ+GV/B/qLrdt5GFNd1PAziSQmZH W1FBb8NEZYMss5dOJyo/D8lgckfchWPB1dn+MJOQH1vmqmCiIyJMuIzJGH/zsEL9HtRq 9MNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=/w2U0GiGwFFrflmNCFpCFLaMnMdqbHDas4my61VJ3H4=; b=STfrz9n0zxoF3KH70L2S5mBnE9hc6Fckfmk4wcpqEwnMFa346HYfnxAzAEv3Wdhnzn 8eX26Ds5/AeIqPi7dj5iiGi1rXvrvyF+ZgJjy40E4K3RcSeylk7Nf89HjOEAkBgNK9wv 34SJI7hQiDbRCo21qjKQFH09XszUozNAvmY7VF7LefA17Oh8F6DMmw4pH/vP1c8Z3LlZ Mt3F0w42M95LMUu/60l8t+c7IOH5gnWhrcIjWYiUw4yIJTMxNia8c00HnAVfOMQGz6xv e8YPSCf+a1U5aI3CzAdflSktTgDj7Rt4tMb7evW2s3iM6ixLSFgTjRJcCq328Mjqv/PD G/zQ== X-Gm-Message-State: ANoB5plzvlAobV2Haj8LVF89hQghn8YiUVI8zJxmCKj3G89LkLSwL7E0 ObOm/pvhQUa+RMc9zMtHnfM= X-Google-Smtp-Source: AA0mqf5bbbM2Ey8aDDMRRxoQANiNABBR5EuqgbA88InhXkY5YtNllspX8hGfwRC2BZ1dEtaaBfF7Sw== X-Received: by 2002:a19:8c1e:0:b0:4b4:6460:24d with SMTP id o30-20020a198c1e000000b004b46460024dmr6846311lfd.386.1668603838350; Wed, 16 Nov 2022 05:03:58 -0800 (PST) Received: from dc75zzyyyyyyyyyyyyydt-3.rev.dnainternet.fi (dc75zzyyyyyyyyyyyyydt-3.rev.dnainternet.fi. [2001:14ba:16f3:4a00::7]) by smtp.gmail.com with ESMTPSA id n5-20020a056512388500b00492ea54beeasm2590371lft.306.2022.11.16.05.03.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 05:03:57 -0800 (PST) Date: Wed, 16 Nov 2022 15:03:51 +0200 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Subject: [PATCH RESEND v4 2/2] gpu: drm: meson: Use devm_regulator_*get_enable*() Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , Martin Blumenstingl , Kevin Hilman , Liam Girdwood , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Mark Brown , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Jerome Brunet Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Simplify using the devm_regulator_get_enable_optional(). Also drop the seemingly unused struct member 'hdmi_supply'. Signed-off-by: Matti Vaittinen Acked-by: Martin Blumenstingl --- I am doing a clean-up for my local git and encountered this one. Respinning as it seems this one fell through the cracks. --- drivers/gpu/drm/meson/meson_dw_hdmi.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c index 5cd2b2ebbbd3..7642f740272b 100644 --- a/drivers/gpu/drm/meson/meson_dw_hdmi.c +++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c @@ -140,7 +140,6 @@ struct meson_dw_hdmi { struct reset_control *hdmitx_apb; struct reset_control *hdmitx_ctrl; struct reset_control *hdmitx_phy; - struct regulator *hdmi_supply; u32 irq_stat; struct dw_hdmi *hdmi; struct drm_bridge *bridge; @@ -665,11 +664,6 @@ static void meson_dw_hdmi_init(struct meson_dw_hdmi *meson_dw_hdmi) } -static void meson_disable_regulator(void *data) -{ - regulator_disable(data); -} - static void meson_disable_clk(void *data) { clk_disable_unprepare(data); @@ -723,20 +717,9 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master, meson_dw_hdmi->data = match; dw_plat_data = &meson_dw_hdmi->dw_plat_data; - meson_dw_hdmi->hdmi_supply = devm_regulator_get_optional(dev, "hdmi"); - if (IS_ERR(meson_dw_hdmi->hdmi_supply)) { - if (PTR_ERR(meson_dw_hdmi->hdmi_supply) == -EPROBE_DEFER) - return -EPROBE_DEFER; - meson_dw_hdmi->hdmi_supply = NULL; - } else { - ret = regulator_enable(meson_dw_hdmi->hdmi_supply); - if (ret) - return ret; - ret = devm_add_action_or_reset(dev, meson_disable_regulator, - meson_dw_hdmi->hdmi_supply); - if (ret) - return ret; - } + ret = devm_regulator_get_enable_optional(dev, "hdmi"); + if (ret != -ENODEV) + return ret; meson_dw_hdmi->hdmitx_apb = devm_reset_control_get_exclusive(dev, "hdmitx_apb");