From patchwork Mon Feb 26 18:32:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Moon X-Patchwork-Id: 206848 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2261316dyb; Mon, 26 Feb 2024 10:33:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWpie9hVaogwG5OH2/A8NhORJRajS/hnCV4Eifxc1yw3HmUx8JXdJ15I+7RXhanCTuZnBabQ7aUBasPAPSvR3lxi6bXhg== X-Google-Smtp-Source: AGHT+IGKl1Dew80A5ce6hFromDVU2am1ssbqf0HUIGBx7JW4JOnmDC+/PBI/uIBW4S0Svbvtxctv X-Received: by 2002:a05:6214:cc9:b0:68c:a83b:b1ba with SMTP id 9-20020a0562140cc900b0068ca83bb1bamr3727202qvx.38.1708972425866; Mon, 26 Feb 2024 10:33:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708972425; cv=pass; d=google.com; s=arc-20160816; b=dFnWPAFTq1TlNnO5jUMpFrq/Bmch1e1KokizfWG5tj3j9MUW581SJU1hwV1xF1okEJ QZy5zycokzNJheAl80fIpSL6xZ+tMCUkmnnkRv5jX2hX6rh6U2v4w98lPGyLm68LnBzx eDALk1pRKVcUDRbeYcMC1lQ0JUrqvtu84xwYSnYqnILhTRntGSF9YHOGs8O96hngDSlZ 7gPPeD8jMlZHBQYF/2r8Tj3GAk6uNw07kALauv1xg0kBCVC0K47XwypUsjpplY/jVazY dfJ9I9ZjJHwEzNlEgR+ze0JXsdhkv43GNToEpE6ycuRz7z1uf34hQq8sianhg5k5k0Iu YpXg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=HAEObWk7q9tpmoQojnoq6Ltq98FhWaI3HcoghSaFe9w=; fh=5/2UCbrJSRJP2UZU5WNmJQgaC6x68eNEvRosKHa3hYA=; b=nvBL+eGg7BIiQMIssuPCyp0FsQnsWCTuytH9k6AGPfMfAE5RnCP0SA0azKI8RQn2PD 1pisgVhVCyk1emg4FQyVvUaHioGChkDD38moGkrf4EwfYp4Ods8kJ6fOIzd9bs0u3dt+ hs7uhOIycgYFWqwZBxj8lQhzQLCXow7pASBV6ErKclZrYRM967y2WXdrMCV1znV8gmFd jT0pwGvCyMJlcCIRpCHdDAXw94pfNLbotlAeBNhedlUeyFnb4PAJuNSZgdUi8BnsQHt6 doEzo02UYzWT7qV+6vOrrfYPanUkyW3ZOSCxijDzjTP/Hyp+t01tZbpg+/MNnb2c66Sb IIdQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VXZZBGZb; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-82142-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82142-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id gv7-20020a056214262700b0068f43478f32si5624437qvb.70.2024.02.26.10.33.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 10:33:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82142-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VXZZBGZb; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-82142-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82142-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A806D1C2460D for ; Mon, 26 Feb 2024 18:33:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E317612F59F; Mon, 26 Feb 2024 18:33:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VXZZBGZb" Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA1DC1DFF7; Mon, 26 Feb 2024 18:33:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708972410; cv=none; b=os6QPDuDeS9bVsaAeiO8/chc70DWDlrOUiXaKLArKbVHnTR8ziwUrnFlEU/MQFNY/jHQSqI7QVB1GvYoKb65IHyY1bRb44/Jv2BODFVNZeNi41wvClJk8MffwiJNojdZRfZNC4P/2bjjcyMg8F8avUbzxvF0K3ZGYlO1lxMbA80= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708972410; c=relaxed/simple; bh=JsfCY4whwMXgC0aq3QAW8sFMe0CHckGaDhVinE9NJQY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=e8e3270Z9manL0o/gGEvxUXJ9wZGbZn8w/pk4ZpiBlE3fI24s9xjOm529z1yP0rFGK8bDeLRJofgxRjuCsfsxomXg0SUyTd/Yznca4AAkw1WwZqr0iRpClbisZcy2qT1cZkDTL39w11Z6T7g8rTMWEHGNp6TSDI3DHK4TymQXJg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VXZZBGZb; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1dcad814986so7170955ad.0; Mon, 26 Feb 2024 10:33:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708972408; x=1709577208; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=HAEObWk7q9tpmoQojnoq6Ltq98FhWaI3HcoghSaFe9w=; b=VXZZBGZbKmEz8gLNyVp/pv9oYURx/1YU7H+TT0N/9bcniFCN3V0kdpvw4D+2XhLEBp v9wqPmaSB+NuNJ12pNzcKoajKr56xakdG+oOxKKjcQrI9wmqXR1d7caRAUPEdGJLX4f5 altbBZ6tzA5RMqjlQrT/F1/WvfAVp2noG/NeycrEvvDLbpWPCO346n7tUSi4AinnkBSI ah4kMuDB3i8sWG+26Gorzgf9KtzYq87Yew4KNaVQJ6EZeQg6cjGyiTr3NmWlGK9ephoi YXm9Jj6kShDjFbVE8yoT92tHixxZch0ip89N89RQZvdAinSZSm8Iopzg0CjvGv3okUSW madA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708972408; x=1709577208; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=HAEObWk7q9tpmoQojnoq6Ltq98FhWaI3HcoghSaFe9w=; b=hC/YFOjvWnarupCqDS/TUrMpXP9f4wvQUo9ZNMyh3u1UmQPnZpLQBBo3zkRGM9zYIL Aub1m1D6y1fJxYERDGmQm9Iglavk3zs5jl0s/EbXkPvhA0ZsdrS8se6VPVq9BgV6gKP1 bbiaCJP5zp1uDpA46NYA+YJYoaVJMoDo8Muc5bJSYqiJK7pAn5pLeQrr8mLNtnujQU3X mUemYLLesZB7wVASwj5G5aiQiyJYs1EK+fbq+BJabwHsGvATOyEUu7BGA1DrIfMqQfyT JCBY2eulXqV3M9ESTFSS40i2w1lo6ICD/LUPyg0xkWnmh8fNbvpvyR6XdZY0JwSHdeke RrVQ== X-Forwarded-Encrypted: i=1; AJvYcCVEZd3D3K4fy1kJTCrq0hr5HnZ8l7sGYRt9uqLX1CyNdeIG/11loZUShoq9cUzPpke5GjZNkEekFP6tzwQTpJLATEzoWY8h00LeEnP+jSRkEAerDVEzHYlKDlFgpkHtbM0JQ2U3fI9pJOgzqmU22/2P/jXmiVdffK2JpZYQiihBoQkg47mWt80Oww== X-Gm-Message-State: AOJu0Yyg0MsxRRlju87rwvoiec/VyRd0llyYPifjoSFUi8SgenfTf+NP uQPnH1cwaNKZ/5csib+YsghzpGwiN1zlx0tDIDpATEkN+RkaYLGFGZ/ZhWbG X-Received: by 2002:a17:902:b7c4:b0:1dc:b01e:99d0 with SMTP id v4-20020a170902b7c400b001dcb01e99d0mr1494288plz.1.1708972407905; Mon, 26 Feb 2024 10:33:27 -0800 (PST) Received: from localhost.localdomain ([113.30.217.222]) by smtp.gmail.com with ESMTPSA id jh2-20020a170903328200b001da15580ca8sm12302plb.52.2024.02.26.10.33.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 10:33:27 -0800 (PST) From: Anand Moon To: Chanwoo Choi , MyungJoo Ham , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar Cc: Anand Moon , linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCHv1 1/2] PM / devfreq: exynos: Use Use devm_clk_get_enabled() helpers Date: Tue, 27 Feb 2024 00:02:56 +0530 Message-ID: <20240226183308.4730-1-linux.amoon@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791987470743797459 X-GMAIL-MSGID: 1791987470743797459 The devm_clk_get_enabled() helpers: - call devm_clk_get() - call clk_prepare_enable() and register what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code and avoids the calls to clk_disable_unprepare(). While at it, use dev_err_probe consistently, and use its return value to return the error code. Signed-off-by: Anand Moon --- drivers/devfreq/exynos-bus.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index 245898f1a88e..153340b6685f 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -160,7 +160,6 @@ static void exynos_bus_exit(struct device *dev) platform_device_unregister(bus->icc_pdev); dev_pm_opp_of_remove_table(dev); - clk_disable_unprepare(bus->clk); dev_pm_opp_put_regulators(bus->opp_token); } @@ -171,7 +170,6 @@ static void exynos_bus_passive_exit(struct device *dev) platform_device_unregister(bus->icc_pdev); dev_pm_opp_of_remove_table(dev); - clk_disable_unprepare(bus->clk); } static int exynos_bus_parent_parse_of(struct device_node *np, @@ -247,23 +245,15 @@ static int exynos_bus_parse_of(struct device_node *np, int ret; /* Get the clock to provide each bus with source clock */ - bus->clk = devm_clk_get(dev, "bus"); - if (IS_ERR(bus->clk)) { - dev_err(dev, "failed to get bus clock\n"); - return PTR_ERR(bus->clk); - } - - ret = clk_prepare_enable(bus->clk); - if (ret < 0) { - dev_err(dev, "failed to get enable clock\n"); - return ret; - } + bus->clk = devm_clk_get_enabled(dev, "bus"); + if (IS_ERR(bus->clk)) + return dev_err_probe(dev, PTR_ERR(bus->clk), "failed to get bus clock\n"); /* Get the freq and voltage from OPP table to scale the bus freq */ ret = dev_pm_opp_of_add_table(dev); if (ret < 0) { dev_err(dev, "failed to get OPP table\n"); - goto err_clk; + return ret; } rate = clk_get_rate(bus->clk); @@ -281,8 +271,6 @@ static int exynos_bus_parse_of(struct device_node *np, err_opp: dev_pm_opp_of_remove_table(dev); -err_clk: - clk_disable_unprepare(bus->clk); return ret; } @@ -453,7 +441,6 @@ static int exynos_bus_probe(struct platform_device *pdev) err: dev_pm_opp_of_remove_table(dev); - clk_disable_unprepare(bus->clk); err_reg: dev_pm_opp_put_regulators(bus->opp_token); From patchwork Mon Feb 26 18:32:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Moon X-Patchwork-Id: 206849 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2261487dyb; Mon, 26 Feb 2024 10:34:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVjJjJDii4KBjvm/uLPXx+euWdjZS9YPkVJYNkTBUwYCytRP7iup4xDjVdDnQSHFOzGcK5etEnYv+tcfw8oKPFtulhuCg== X-Google-Smtp-Source: AGHT+IEAUmyz9D0lHEaZc4egh+sEz/5mbYParaUZfHTUsEsoSI3QUGDtLTmQiDGW9KYoDxnXl+C+ X-Received: by 2002:a17:90a:c006:b0:299:5b06:5814 with SMTP id p6-20020a17090ac00600b002995b065814mr5435754pjt.40.1708972443272; Mon, 26 Feb 2024 10:34:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708972443; cv=pass; d=google.com; s=arc-20160816; b=olndhJfipM70KyDmXycFVGaUK+6cKKr8zeneMC14ZVhw8FJnhj2XTrvHj4OXhQJIeU 0DDxFMJ4iZEr9e9gxdBHMs6dVDGdbIjL2LmypTGPp0VAVwUkt20FG37RQ7b8mlQZ/CcQ ecFFrGCxrM80C/MNDCrV+R1z2GH59TH+dLYegx43GH2WmVYQyrFrdSon448etMmrLzKn G7as9CzSWJd7NhBc4JK8F2aKMIaM1XBEV+8vtPZmS088EcTxmIZtWHWOk8JJA3kXebvt TNX1pHd2SePYvhbS+ujKrWXXqnkDmByapmnRsgVIT0l5Jg5SVvlVXixX/8k6Q08ckzpO jRdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=3yRd6vmoyv4T18CdVodPMErjLFH3rEI8d97qlyMUvhQ=; fh=/B9AqQoxs1RFo2OYW5G2KjlE/VQN/LGK5ZJZhdN6lBE=; b=baTAT5+kD2+Mbf3Ydp+1EXyzcYBlfosb9asoFAWLovjT6u5ZscOsFk0gyK/Syoau02 bPAHzy6njZlI18VUpzL9xYfS4iSGKsRxWjbDNz9/sGyqLJxAm7NKXk2caxHvIoOkJpqr 9HeBjK3AiMAQwY9XzRj44/k3f8WVOd1EEShA/PMTZHNZ3OXUoWt4I+BLxklXlEyjB0KH Q/w9b7gHg5jFvSkLM0sTHocFa4ECdd1Pr7VU1FcV1gYCY0LIDcprgbuzn7G1ztmBkb2c WTyJ5pQouOsAAlAQ3/oGnZmNLYwFaTEeBF0SBuakSNj49dkRX1mgrOIJ7iQz4Q0jFlZa Bvmg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PozRxbyB; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-82143-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82143-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id mw10-20020a17090b4d0a00b00296a1d0ce70si4225417pjb.18.2024.02.26.10.34.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 10:34:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82143-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PozRxbyB; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-82143-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82143-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1AA5828F010 for ; Mon, 26 Feb 2024 18:34:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EBCA412FB3E; Mon, 26 Feb 2024 18:33:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PozRxbyB" Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F35E91DFF7; Mon, 26 Feb 2024 18:33:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708972417; cv=none; b=SsLhDDtHGmvlaX22DCCZJJ3ERHg6truLa/W7OECi8HGpyk9DW/w/mm1HwvS51yBtAwkPFE4Yq+ynGIQE3Im2ds2HygAUYLjgbWd0ylaGSYNeLKQnuZKHp28HaNMMB69G+/OU4yls4vQ/S7f4A4xA1ACCbP17BVssS9taZDatsxk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708972417; c=relaxed/simple; bh=EWxoD9j6rTxWBOpnl2KFgmZwKCO3iFiFXK60kAnp+WM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DU8kfcepavmpHoraROH8v0uugCJGrQ7vT/Nn7wlsWNvmuPQKGnPJV7DGuA0lfCL3Lxxx9UL5YgEC2ayrSQXf5N/16Awj4SGpvIMJZ1aAHvJSLNL++UDD2cpTNLQvYKlG6/IUdZfy6fg1CKSWreiYG2ytUvceF11huxes7m3Kxb0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PozRxbyB; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1dc1e7c0e29so15199845ad.1; Mon, 26 Feb 2024 10:33:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708972415; x=1709577215; darn=vger.kernel.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=3yRd6vmoyv4T18CdVodPMErjLFH3rEI8d97qlyMUvhQ=; b=PozRxbyBUGq48RU40EDTOm3dzx+6iE2IcDSxfiIL/Cp6DR3zuARPVNsA3uXvgwGEnZ p4r1EDkXfddAEduo6cYa4pwgSU5Gk6N4K06sr9n4g6wf4CGrS287Ekbdkwl5xVglFutr V1Fbc07ZkgvzF424+DWVZqB2+d5DCfSkhm0nbNX2Tyz0ZJqCF+FxzlvtfuQK7CjMo+7y WzypthMVMyUcYLGfLUYfuBdge8o1kiJyzBNpcKTsRSJJJrv7xy2cYaPrJrsuhrhzurkg 9M+grH+L36ddOlkyIjpNQ4a9YNr9s3YI4HIJcQ1ZmilV4CehZ2GxAjtEuD+EercWWGHO H2tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708972415; x=1709577215; 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=3yRd6vmoyv4T18CdVodPMErjLFH3rEI8d97qlyMUvhQ=; b=KNKFPSPTYddT6WTXdTtWynlciGGvO9n/VfScxOUbhQwneRT/TkabVVF+yoiuU4IrAx nvAq9mafvvuIj0TDL6yUhpKYa9XxEeZT1EqLXuubLDHrKJ1HHOosuMxEVOy1Vq4RdYsk mu66p4tfZAlRFQciYssjkAteQ7bpIOuvNhLOKFC5OsU/W2bY2nDhb9iHldflQf7+F2sk EhiauztTsiliwMJl3XVHAWBwXCKKfCuuxI2RuRAdxWbH0xzNcHEomcFjs0DQe87yvFMZ zs4Hdl+ksGTsFAPxiA5e9wVUXLAdqsWzPieT/Ybz2dNSAHhdJNOOZhC6p2RLm5OOLThw 68FA== X-Forwarded-Encrypted: i=1; AJvYcCXGSmXYR9GbqsJbfPOJisgui9112qlNawv71GeaH5+1SDELXkeWsvCIRikAISgLpeSd9RWdDlopoXEGeuvGi+j2sblndVxCBUCrOi73YSWg54wFl4oiH7GWiGfc+NXfOKSLZX6IFysNmx3m/dXaFVhjwkAcgItCplA8km+zqNaR5LZGOr3H+P1BjA== X-Gm-Message-State: AOJu0Yw3qym5lszRZgFXG3K62ltXEV7RfOXfzt8zmOcUN+tbmkULLNtu bwGW2KFCCcy5MUTKPfJDEjgtoITuDqOjTBn3jAq8cPWDhBR+GwF2Eq4KQyiZ X-Received: by 2002:a17:903:1d0:b0:1dc:7f98:d9bf with SMTP id e16-20020a17090301d000b001dc7f98d9bfmr8261579plh.59.1708972415188; Mon, 26 Feb 2024 10:33:35 -0800 (PST) Received: from localhost.localdomain ([113.30.217.222]) by smtp.gmail.com with ESMTPSA id jh2-20020a170903328200b001da15580ca8sm12302plb.52.2024.02.26.10.33.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 10:33:34 -0800 (PST) From: Anand Moon To: Chanwoo Choi , MyungJoo Ham , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar Cc: Anand Moon , linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCHv1 2/2] PM / devfreq: exynos: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() Date: Tue, 27 Feb 2024 00:02:57 +0530 Message-ID: <20240226183308.4730-2-linux.amoon@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226183308.4730-1-linux.amoon@gmail.com> References: <20240226183308.4730-1-linux.amoon@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791987488689707801 X-GMAIL-MSGID: 1791987488689707801 Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. If CONFIG_PM_SLEEP unused, they will simply be discarded by the compiler. Signed-off-by: Anand Moon --- drivers/devfreq/exynos-bus.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index 153340b6685f..63a3e0c0a682 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -454,7 +454,6 @@ static void exynos_bus_shutdown(struct platform_device *pdev) devfreq_suspend_device(bus->devfreq); } -#ifdef CONFIG_PM_SLEEP static int exynos_bus_resume(struct device *dev) { struct exynos_bus *bus = dev_get_drvdata(dev); @@ -482,7 +481,6 @@ static int exynos_bus_suspend(struct device *dev) return 0; } -#endif static const struct dev_pm_ops exynos_bus_pm = { SET_SYSTEM_SLEEP_PM_OPS(exynos_bus_suspend, exynos_bus_resume) @@ -499,7 +497,7 @@ static struct platform_driver exynos_bus_platdrv = { .shutdown = exynos_bus_shutdown, .driver = { .name = "exynos-bus", - .pm = &exynos_bus_pm, + .pm = pm_sleep_ptr(&exynos_bus_pm), .of_match_table = exynos_bus_of_match, }, };