From patchwork Tue Jan 19 07:15:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 12029291 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F359EC433DB for ; Tue, 19 Jan 2021 07:19:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C1BE123132 for ; Tue, 19 Jan 2021 07:19:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728280AbhASHTQ (ORCPT ); Tue, 19 Jan 2021 02:19:16 -0500 Received: from mail-lj1-f180.google.com ([209.85.208.180]:37596 "EHLO mail-lj1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730654AbhASHSq (ORCPT ); Tue, 19 Jan 2021 02:18:46 -0500 Received: by mail-lj1-f180.google.com with SMTP id 3so552915ljc.4; Mon, 18 Jan 2021 23:15:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=W4lO/s0iMGk19qMdPoDZMWO0rMg1GjXtK6eR1C/M5p4=; b=KHwzAQuBv+t/I9tPHnlPbswlu/QYd3bElfHe2JeoL2rl5gldY8HuI8bkMq59Kqcsqw Z37tElogP7QS6SC+Y8FqaISD0VoYVawjMGX4CSvWV1jDvX7NfZZeU8XTdZB7llTQRIwS YTr0jFaAG+X1KKqunh5yZy5Sarb1wzNvCaBGHdqTqS0rEqhvrJYS76+8yFaVof31aZMu AosQus3YOlRJFJdsKF0xgklnfrXjFtNQEKMCHs2owYmV2cjCOf4inNlph5eCd7mfPRzI 0Mib0pj9uEAEwiPQPcTkTG92qMpKbgImSQvg7qV7jV4WDuxDwIpr+Up6mWUgbC5UlW81 XJFQ== X-Gm-Message-State: AOAM530t22DFh8GTlJYc3g1AvWee03F2mGUen2y7lr+Qkn0kpmzfokS9 5nzrIvJ1+k1nEgR/Qhzk2p8= X-Google-Smtp-Source: ABdhPJyLpgE/ALX+EKI3BWiDJyqR7ao9BgTLuUUwiFd6rzyZ+m4LXd/ylEWcJpRwjYs52hGudIroHA== X-Received: by 2002:a2e:a58c:: with SMTP id m12mr1361909ljp.444.1611040527628; Mon, 18 Jan 2021 23:15:27 -0800 (PST) Received: from localhost.localdomain (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id w13sm1644155lfu.299.2021.01.18.23.15.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jan 2021 23:15:27 -0800 (PST) Date: Tue, 19 Jan 2021 09:15:17 +0200 From: Matti Vaittinen To: matti.vaittinen@fi.rohmeurope.com, mazziesaccount@gmail.com Cc: Lee Jones , Rob Herring , Liam Girdwood , Mark Brown , Matti Vaittinen , Michael Turquette , Stephen Boyd , Linus Walleij , Bartosz Golaszewski , Alessandro Zummo , Alexandre Belloni , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-power@fi.rohmeurope.com, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, linux-rtc@vger.kernel.org Subject: [PATCH v2 03/17] clk: BD718x7: Do not depend on parent driver data Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org The bd718x7 only needs a regmap from parent device. This can be obtained by call to dev_get_regmap. Do not require parent to populate the driver data for this. Signed-off-by: Matti Vaittinen --- Please note that this same change has been sent individually: https://lore.kernel.org/lkml/20210105123028.GA3409663@localhost.localdomain/ It is present in this series only because some patches depend on it. drivers/clk/clk-bd718x7.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/clk/clk-bd718x7.c b/drivers/clk/clk-bd718x7.c index b52e8d6f660c..17d90e09f1c0 100644 --- a/drivers/clk/clk-bd718x7.c +++ b/drivers/clk/clk-bd718x7.c @@ -31,12 +31,12 @@ struct bd718xx_clk { u8 reg; u8 mask; struct platform_device *pdev; - struct rohm_regmap_dev *mfd; + struct regmap *regmap; }; static int bd71837_clk_set(struct bd718xx_clk *c, unsigned int status) { - return regmap_update_bits(c->mfd->regmap, c->reg, c->mask, status); + return regmap_update_bits(c->regmap, c->reg, c->mask, status); } static void bd71837_clk_disable(struct clk_hw *hw) @@ -62,7 +62,7 @@ static int bd71837_clk_is_enabled(struct clk_hw *hw) int rval; struct bd718xx_clk *c = container_of(hw, struct bd718xx_clk, hw); - rval = regmap_read(c->mfd->regmap, c->reg, &enabled); + rval = regmap_read(c->regmap, c->reg, &enabled); if (rval) return rval; @@ -82,7 +82,6 @@ static int bd71837_clk_probe(struct platform_device *pdev) int rval = -ENOMEM; const char *parent_clk; struct device *parent = pdev->dev.parent; - struct rohm_regmap_dev *mfd = dev_get_drvdata(parent); struct clk_init_data init = { .name = "bd718xx-32k-out", .ops = &bd71837_clk_ops, @@ -93,6 +92,10 @@ static int bd71837_clk_probe(struct platform_device *pdev) if (!c) return -ENOMEM; + c->regmap = dev_get_regmap(pdev->dev.parent, NULL); + if (!c->regmap) + return -ENODEV; + init.num_parents = 1; parent_clk = of_clk_get_parent_name(parent->of_node, 0); @@ -119,7 +122,6 @@ static int bd71837_clk_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Unknown clk chip\n"); return -EINVAL; } - c->mfd = mfd; c->pdev = pdev; c->hw.init = &init;