From patchwork Sun Jun 5 16:57:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 2005 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 019783F0FB for ; Sun, 5 Jun 2022 18:57:11 +0200 (CEST) Received: by mail-ed1-f71.google.com with SMTP id a4-20020a056402168400b0042dc5b94da6sf8938303edv.10 for ; Sun, 05 Jun 2022 09:57:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1654448230; cv=pass; d=google.com; s=arc-20160816; b=jLiDarSD5V8+B5HqEIyTM19A5KlksBBkoIZkLxgCEUgnJ1HTqxIuGl4SwzhVAaQj4Q MnPc8euSY0Mijm1Tsrc2TwJViV9O+Pu34J9W5/opyGLabQeWwryTRPXQrf69mErSI+ep H4Ue5FMq6hZy0r3u3V6LgDxAHfL1QBCEH8yZ3jYJbOXViqde0Ubw+vDA044hdz38m5F/ ARDvDrqsTX5Z6yRITSVazNHzGqNmU/C9hH0a/EvdldgkQBm//UgfE0SNR6+5/V0GtxxY +/vHOZ6wRLyLU4q/LO8ofKet5MQLs1z7Ve+tnvZMu+4oPxhs4dFz9UyK7QVlxLUhW+Y1 6yUw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=DN1MyXYkO7blhwXbiGVDCEsqRtGCCYJQhDE4/eoGBUI=; b=HSjQK8CaGHI0TgRFfDOuO/HqeK3bSsejBxgmFYQljYq19ydC7ag2ZwrA+ifddkMdHb zvQy2Djl84IA25g3ytv40UG5n+od+Um9mQNPyRVSD2Y4uJvCuH0H+7MdBO7NmXHGFDI9 WWiPRCz/yFuAnMDK8syR4S7nTyGqHX+8X9z2JZgi3ciTGFNvYi7p+O+QY2f75WhMRi6H 502+I7t1/8PPVarZ4pP4aDGci/2sDX46H+duGA4GMUk6ucD4qnl1FAeBbB/ozbfxqr9a okc8uQFCC7rDs2G+l2yUzIn9iMM0APTTVCeN2Ovnz2peSofz5CnhZXAr/Y9bpolFxDE7 vl0g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PJUDXWiC; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=DN1MyXYkO7blhwXbiGVDCEsqRtGCCYJQhDE4/eoGBUI=; b=HAsMl8QWQKUSSwhHxyW3EvAQb99AAOKwY42iBfoYGxHvyTpgFrKhKy7g57GqstQ1FE 7pVEfTDP1vi1g+L/ItNK+HXVIiHRGeOwVkjXlHNV/3ZtFDEBsIVQ5w+sKDijh3a97Z/s BfE4XqMLUNIcVmK21AcpI793Esq0oE59BLEco= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=DN1MyXYkO7blhwXbiGVDCEsqRtGCCYJQhDE4/eoGBUI=; b=vqvbJfERgkiVrMUBtEAOEB5BJs9jOOOSO/tdWWuri/2wI7myoQKX36RiMLvxCjGBoV uXYGZNSmnLVReH4tHSEVTUJ3gGwN/OT6W7ylwAmX8P8tyQUMqcqa85kvKmRwdiMnQtoW NwMudicbrY7dT0u+yIkPvHH2seW3VDjD6F2QCMYMOXxeSgSr+hLqTl/LKI8jRzfnu65Q CCQYUn0jgDUez+RI608GZIlmU7qDq7mBO+xM9svVMF5z6kGLBTUiK4/1OXXhsrh9A+cm pwDWPJAS4/5U+BW/VdNymSwYz/JqZQN5f7F6g6r06ZumaDrZxQ8GbyMhzMGm3G7o5K5D lhUQ== X-Gm-Message-State: AOAM530MIHSG+suZ0l13+Hm0zK1W/lcDTv3kUQUq29RbymWIF34JUPrd xU71JAvblXC4WuPYlj1zP2VQWtpp X-Google-Smtp-Source: ABdhPJzkgPCrRW92xERtQRvYgxxcJcXKnZIx6XF0tKKSEAVADY3xdwkjNhpU0pz6pOoIJR10a5TpKQ== X-Received: by 2002:a17:907:1c01:b0:6f4:2692:e23 with SMTP id nc1-20020a1709071c0100b006f426920e23mr17862378ejc.243.1654448230615; Sun, 05 Jun 2022 09:57:10 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:906:95c1:b0:6ff:45d:c05d with SMTP id n1-20020a17090695c100b006ff045dc05dls359442ejy.5.gmail; Sun, 05 Jun 2022 09:57:09 -0700 (PDT) X-Received: by 2002:a17:906:14d5:b0:711:c55a:998 with SMTP id y21-20020a17090614d500b00711c55a0998mr3951572ejc.708.1654448229276; Sun, 05 Jun 2022 09:57:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654448229; cv=none; d=google.com; s=arc-20160816; b=heY4djvDj0vKW91MBAr4b5sNAajI3sZFDRV1Hg8Lo9kDSZ34vi177jiodqS6OFx1Bb Qtqe/FKXKaPwMmENv0q5TA97Yt0a+ntsk5m3yP72j2AqbzjK4cghoIoV0mhCW6AE7mHw qGe8mjgl9My9b42QbomktpqS/UTMYIGaPKde7yw0EuAXzGtVidtCdV+37iG5uxrHtst9 CL6ZvEY4Z96RJebzjk3EgcjZIEzFEpUobU0Li+UzpVBnMc2FkIvIUF9dNSpz6RdYZPMS pFbsEf6wOJGh7dJrkfWHSqBQmgZp98TGnvzGc2G9/vYEErKCns2xrexWkTf6p/CkPBQW k8UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=4gqvv7SB+vS5l3sqUpll/2cHcxIjp6YvEKZyVVCwBAk=; b=bkYUeEFJiOUdsAuQb80BEefkQLiun5aRspoDq1lQlzvrNh5lMr5WgM0OW2AHTmzwYj ZUApAIv/QXbjJklT9ezB/9A9pu0A2fAuigN67J05xuWOF3TQfLKoDAU536CUrUIN1w+D ukkW7Vsea9iqlgpFsbJCsLVxZ5ApwdZ06JOmR/i3thnUs8+NymNHMc5TMfcblhDdeAdw 04aN1tPyJH4P8TUKblq9Y1lLyMDFiC/TukRTH0P3SK7EIofZCPeAm+mBiB3zoySpzKfZ miaFKwazMmDMjneIC03tefxnVaIoTbl5MzP34SprGgu4i5YnbMDT3EpTFLNGVs/LvkH3 lgZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PJUDXWiC; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id p3-20020a170906604300b00708886b12f7sor5294695ejj.55.2022.06.05.09.57.09 for (Google Transport Security); Sun, 05 Jun 2022 09:57:09 -0700 (PDT) Received-SPF: pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:906:c797:b0:711:8c01:32d4 with SMTP id cw23-20020a170906c79700b007118c0132d4mr4733057ejb.205.1654448229001; Sun, 05 Jun 2022 09:57:09 -0700 (PDT) Received: from localhost.localdomain (mob-83-225-9-201.net.vodafone.it. [83.225.9.201]) by smtp.gmail.com with ESMTPSA id b12-20020a170906660c00b0070e3f58ed5csm3260761ejp.48.2022.06.05.09.57.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 09:57:08 -0700 (PDT) From: Michael Trimarchi To: Matti Vaittinen , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org (open list:COMMON CLK FRAMEWORK), linux-kernel@vger.kernel.org (open list) Cc: Dario Binacchi , linux-amarula@amarulasolutions.com, linux-clk@vger.kernel.org (open list:COMMON CLK FRAMEWORK), linux-kernel@vger.kernel.org (open list) Subject: [RFC PATCH 1/3] clk: bd718x7: Clean up the code, no functional changes Date: Sun, 5 Jun 2022 18:57:01 +0200 Message-Id: <20220605165703.1565234-2-michael@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220605165703.1565234-1-michael@amarulasolutions.com> References: <20220605165703.1565234-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: michael@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PJUDXWiC; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Signed-off-by: Michael Trimarchi Reviewed-by: Matti Vaittinen --- drivers/clk/clk-bd718x7.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/clk/clk-bd718x7.c b/drivers/clk/clk-bd718x7.c index ac40b669d60b..04cc0beb67df 100644 --- a/drivers/clk/clk-bd718x7.c +++ b/drivers/clk/clk-bd718x7.c @@ -81,27 +81,28 @@ static int bd71837_clk_probe(struct platform_device *pdev) struct bd718xx_clk *c; int rval = -ENOMEM; const char *parent_clk; + struct device *dev = &pdev->dev; struct device *parent = pdev->dev.parent; struct clk_init_data init = { .name = "bd718xx-32k-out", .ops = &bd71837_clk_ops, + .num_parents = 1, }; enum rohm_chip_type chip = platform_get_device_id(pdev)->driver_data; - c = devm_kzalloc(&pdev->dev, sizeof(*c), GFP_KERNEL); + c = devm_kzalloc(dev, sizeof(*c), GFP_KERNEL); if (!c) return -ENOMEM; - c->regmap = dev_get_regmap(pdev->dev.parent, NULL); + c->regmap = dev_get_regmap(parent, NULL); if (!c->regmap) return -ENODEV; - init.num_parents = 1; parent_clk = of_clk_get_parent_name(parent->of_node, 0); init.parent_names = &parent_clk; if (!parent_clk) { - dev_err(&pdev->dev, "No parent clk found\n"); + dev_err(dev, "No parent clk found\n"); return -EINVAL; } switch (chip) { @@ -119,7 +120,7 @@ static int bd71837_clk_probe(struct platform_device *pdev) c->mask = CLK_OUT_EN_MASK; break; default: - dev_err(&pdev->dev, "Unknown clk chip\n"); + dev_err(dev, "Unknown clk chip\n"); return -EINVAL; } c->pdev = pdev; @@ -128,15 +129,15 @@ static int bd71837_clk_probe(struct platform_device *pdev) of_property_read_string_index(parent->of_node, "clock-output-names", 0, &init.name); - rval = devm_clk_hw_register(&pdev->dev, &c->hw); + rval = devm_clk_hw_register(dev, &c->hw); if (rval) { - dev_err(&pdev->dev, "failed to register 32K clk"); + dev_err(dev, "failed to register 32K clk"); return rval; } - rval = devm_of_clk_add_hw_provider(&pdev->dev, of_clk_hw_simple_get, + rval = devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, &c->hw); if (rval) - dev_err(&pdev->dev, "adding clk provider failed\n"); + dev_err(dev, "adding clk provider failed\n"); return rval; }