From patchwork Fri May 10 09:40:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Moon X-Patchwork-Id: 13661201 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 EE88CC25B10 for ; Fri, 10 May 2024 09:41:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0dfXvAu2I7Nr8Dg7cjKWAbD08iU9plkAu8qjn8cJpRs=; b=L8XS0wp2bAJnu+ 8MkyoM2GRXbA8ryLS0agvhW8zF8gOZngdCRvRECxpQE2uPfoPcrOvlS7Q2UV7/vTCdHdMEgRGPaOJ 76YadY1mSTiKP9BKPDN1t6awmrAKJBuQ1PQPnUStN80BP7sjGt0mftOe9HOXY11cjZN1yx8b+V1eH kRwSl2HqKiJTiEyZO6LnEGDfJLXjqfqgssBt1SMiZLdxU+NvHJdEXcrqs9qYZ8GFlGw/o6ATI2Jxt /xC9P/+5Ydaw8T3udmIPMuEG0dpgGg/OvlTMPvouMjEpO8MZWuv0vqSx2XOfCSB/5DFcs0iSz1PdQ UyZCIqVI9xTqStHh41Ng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s5MkT-00000004jfl-3HUJ; Fri, 10 May 2024 09:41:05 +0000 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s5MkQ-00000004jep-2ONV for linux-arm-kernel@lists.infradead.org; Fri, 10 May 2024 09:41:03 +0000 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6ee13f19e7eso1641622b3a.1 for ; Fri, 10 May 2024 02:41:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715334061; x=1715938861; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xYCA026a98+jinm4XXjivyCMpzTaBQNxk+cwgCPrDy4=; b=D2SSDfzQZdCsrCVk0yDxE8JJgAG6+CWwek+hQj4VN9cY+QqHfXBzPeqXHzBkSocmsE 53ey63ZhSAGlu8qWpvGhhwzPwLrdAtxmU8VefV/eNMI478tWDUegBxfQ8SwNLxYo5hUL inRLrvkMkho6si0W75jNphJSEJfSD6z6D/511V6+SHVqye+AEf4i7A7Dm8dChOac7Fdk E0XxZY/8skTFfZe3JOqi9c4+p/jf0+NjOeXfAJDIAmz9hJMidNbXypbIXx6RU7OhsANB MAwSB6HzDDyVaSj807tcXjk+D20QopMVX6+7dU6/rGMWOp+LYZXAwzg+uxwq8+mbg7q1 yolA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715334061; x=1715938861; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xYCA026a98+jinm4XXjivyCMpzTaBQNxk+cwgCPrDy4=; b=WSReDGue0xmycS2TuMnOHTij3hQ+pgxIP2M/PkLFkjyB03maKREl7x+vcLW+ZJwTCV SBZ3K50Q9Ce+sNq5Mq+0rh/7N8Vy8sVq2oCiOMCmm0AdjH9UbORZI9yGozBT/whvADkh prjNgXInf66xaz6tOv/RY5NgrGUg4mNqmGa2I8fz+Vi0u8zW5ydD7y+qWW2bZekOpGEc 3jUwe0qzpSHDbSi0BBukF45m+H4NPQW3bo4f7AhI1OdbhCVW/dvaQDXObptcHKLlqoBC SIJPAziOKQn/JMHZaDI/E/S+FJMLIpNwi+pzaKDR+FVlk6ejV2juAOysf1nWVPeWszrJ RU1w== X-Forwarded-Encrypted: i=1; AJvYcCVo2Vq1h4+TZQbw/UuLH83eqeVFaigmIH83pgtPtxUZfyfgI7eQNfBo+pNmEi9uO+8FQETAGTk9O79AHuRRSDMrf6078q/S6w1IQ1uhF5rqx16Emh4= X-Gm-Message-State: AOJu0Yzfk+YCz4505RhmorPEVsonH7JzSiXok8qG4qE/hDdJyWwB1Aia XOxutmcjlNvfDLYAioE7m71503iBv/j/htFK15hxStL8RF4mrkzH X-Google-Smtp-Source: AGHT+IGv0EhQaZQv5264QLirP3eVLjx8maXcHjKU/FgFJ8ZT4iudZpiwgz4HLBkM4c/WXo008palAg== X-Received: by 2002:a05:6a00:3cc7:b0:6f3:e6e0:d9fb with SMTP id d2e1a72fcca58-6f4e02c6a0emr2055840b3a.11.1715334061383; Fri, 10 May 2024 02:41:01 -0700 (PDT) Received: from localhost.localdomain ([113.30.217.222]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f4d2ade28asm2554518b3a.139.2024.05.10.02.40.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 02:41:01 -0700 (PDT) From: Anand Moon To: Chanwoo Choi , MyungJoo Ham , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar Cc: Anand Moon , Christophe JAILLET , linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 2/2] PM / devfreq: exynos: Use local clk variable instead of exynos_bus member Date: Fri, 10 May 2024 15:10:25 +0530 Message-ID: <20240510094034.12493-2-linux.amoon@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240510094034.12493-1-linux.amoon@gmail.com> References: <20240510094034.12493-1-linux.amoon@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240510_024102_631284_3F408EC1 X-CRM114-Status: GOOD ( 20.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This commit modifies the exynos bus driver to use a local clk variable for clock handling instead of storing it in the exynos_bus struct member. This helps in simplifying the code and makes it more readable. Suggested-by: Christophe JAILLET Signed-off-by: Anand Moon --- v5: New patch --- drivers/devfreq/exynos-bus.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index 7d06c476d8e9..e55ae59a8ae7 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -34,7 +34,6 @@ struct exynos_bus { unsigned long curr_freq; int opp_token; - struct clk *clk; unsigned int ratio; }; @@ -241,13 +240,14 @@ static int exynos_bus_parse_of(struct device_node *np, { struct device *dev = bus->dev; struct dev_pm_opp *opp; + struct clk *clk; unsigned long rate; int ret; /* Get the clock to provide each bus with source clock */ - bus->clk = devm_clk_get_enabled(dev, "bus"); - if (IS_ERR(bus->clk)) - return dev_err_probe(dev, PTR_ERR(bus->clk), + clk = devm_clk_get_enabled(dev, "bus"); + if (IS_ERR(clk)) + return dev_err_probe(dev, PTR_ERR(clk), "failed to get bus clock\n"); /* Get the freq and voltage from OPP table to scale the bus freq */ @@ -257,7 +257,7 @@ static int exynos_bus_parse_of(struct device_node *np, return ret; } - rate = clk_get_rate(bus->clk); + rate = clk_get_rate(clk); opp = devfreq_recommended_opp(dev, &rate, 0); if (IS_ERR(opp)) {