Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp85754iof; Sun, 5 Jun 2022 21:55:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCO7hDoFkfRQoQGFo+M5OSP/AyA8JYPuXhFWTwLYMRTnqTRUVjdCiKaZJiKhvOxC8O+oRI X-Received: by 2002:a63:210e:0:b0:3fd:9c07:7670 with SMTP id h14-20020a63210e000000b003fd9c077670mr5366131pgh.222.1654491343863; Sun, 05 Jun 2022 21:55:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654491343; cv=none; d=google.com; s=arc-20160816; b=BRWJlSPHrICQVLgd+WSB+y/3yPwhS6vqjUxZI/H18OShPVK8UdCdJWyUv7YYYFlMcn 6kn4/N4lClxDdhHfu0IXUlrldvF7pHOaezt4gxT6ik7qv/2Dqh9SHnGTO47R7jThlYwn XHfblPeNbPxZxmwd79gA0QoX5CHHIzDuljkqIjw9Gufz0SgsMiiT49iid8ug7wXCUQeQ CsiEC6o4N84SUSPRm4rPxBvrgeQVhzCjZEXtbrfi37FfTCA1ZxQeq8aisD0oLXbFyO2q LvHx76MItAbPB2pU9h8NsBbcyrhtCWkixqUqeUf+xIlGPpGdN1NAsobPE39kSY1JDGt8 PlFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4gqvv7SB+vS5l3sqUpll/2cHcxIjp6YvEKZyVVCwBAk=; b=PTVjQnTgia19PKEYgWwWEKT+iPFYhBXiI73xnpBvLUpx7c3R3D+JY+WioSXBWdNJcd 51y1IT5B4Agiua/4yZWwt5cjSUlKEp/iHM5iftNjNEHJGMl3G1+IroCUQh3uSHHEvU5Y QPh0W01lpvRfUoiZ+4/sWIxG0eGH7m8LTwKifATG46TrqVHMlVLRhqvYBHkwCe0ohJ60 BpIkJgctZ3lFvDYbteU460Tb5k5Zy8WdelUDykVr9ZR2N+xmWww06o4NzTA1TCSuBvRn sVGgN0BVQUAVVupIdTJihoYFNTS7pqH7Jeo6o1EXJ/R+nqG0gCn4F5whgLqYFfs+YVqj 2ABg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PJUDXWiC; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id w11-20020a170902e88b00b001614cd997a6si21453245plg.481.2022.06.05.21.55.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 21:55:43 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PJUDXWiC; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5F85FC0E33; Sun, 5 Jun 2022 21:08:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351327AbiFEQ5O (ORCPT + 99 others); Sun, 5 Jun 2022 12:57:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230102AbiFEQ5N (ORCPT ); Sun, 5 Jun 2022 12:57:13 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7641F25C4 for ; Sun, 5 Jun 2022 09:57:10 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id n10so24878764ejk.5 for ; Sun, 05 Jun 2022 09:57:10 -0700 (PDT) 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:content-transfer-encoding; bh=4gqvv7SB+vS5l3sqUpll/2cHcxIjp6YvEKZyVVCwBAk=; b=PJUDXWiCMxR7AxgHes6RlyFPB4Hqhx0E/apkUeoejAP+4Qn4En61gOevroQ0A8O9tb U9S6gjEE35m0eRzkqnebWnEBkovvW9Dv6AjjQp86oGqgVON44begcZjF5JB8hgoU7XXq LvO9+z7uUIIXRoy28HKyqrMLWUWgpHl0BWRRg= 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:content-transfer-encoding; bh=4gqvv7SB+vS5l3sqUpll/2cHcxIjp6YvEKZyVVCwBAk=; b=Cbc/QVqn5kRO99x+L5vEZbimtIEkHugZFTLAM6bP7MqAXpdQvofVIjYkkEwhoNUwQi f4PbhNxOA5eXCnDuNFXvLakyGsCIbyxOVcbX6NZ88tS1eE69ArqvyHDmVH8rOT/f4NIM zTqOJKR97q3IrVLwwcOgzxlwFarE2dKlgPLL6WzDYotu9q4LCQm8gdsrt9yrxSeqe6hY xbT4qr5hrlvuTQc8AVaxWLpTsPBNPoNeHmXYUVnxPEJbpvmDVGjK0dg/T91ogZ/FrlEP moA+ou3gIwOoY2Kcujxm2j0+0M1Bxxl03qkBVBpiTYOjYzIScly5WN8hP32VUT/QocVC G1zg== X-Gm-Message-State: AOAM532Noq381zNeV9/22WIUC53lQ3hcPRNMmBmgNn7plvzUy+zHI6NA gAebfsVBklIBJ9xKHJcAQChM8g== 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Signed-off-by: Michael Trimarchi --- 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; } -- 2.25.1