From patchwork Thu Dec 6 21:59:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 10716987 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 232F714E2 for ; Thu, 6 Dec 2018 22:00:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 12CA52EE7D for ; Thu, 6 Dec 2018 22:00:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 075E32EE81; Thu, 6 Dec 2018 22:00:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87DC72EE7D for ; Thu, 6 Dec 2018 22:00:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725939AbeLFWAG (ORCPT ); Thu, 6 Dec 2018 17:00:06 -0500 Received: from kirsty.vergenet.net ([202.4.237.240]:55914 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726003AbeLFWAG (ORCPT ); Thu, 6 Dec 2018 17:00:06 -0500 Received: from penelope.horms.nl (unknown [64.124.208.80]) by kirsty.vergenet.net (Postfix) with ESMTPA id CFAEC25BF81; Fri, 7 Dec 2018 08:59:37 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verge.net.au; s=mail; t=1544133578; bh=U7grjBLbWCNK4XiFoCXxQoXgJFp1XiHIgghx55CM66g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WyQG6iMADQIM9V0I5yy0VD0x7Mn3mF0KOCzv8kcuBy9aaZwOlOJoyhY5Vc2Z1oxvU iVPaY5vhfekETCy9VkgvbbNbOrEZ/wWBuFnzssK6sbPNo4Pbw899blIIG658GBivIH eM4l3UzyY0s+Mow8DPkVwUvZ8rrzlCwv/qMwSxqo= Received: by penelope.horms.nl (Postfix, from userid 7100) id 1F118E23292; Thu, 6 Dec 2018 13:59:35 -0800 (PST) From: Simon Horman To: linux-renesas-soc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Magnus Damm , Geert Uytterhoeven , Simon Horman Subject: [PATCH 8/9] ARM: shmobile: R-Mobile: Clean up struct rmobile_pm_domain Date: Thu, 6 Dec 2018 13:59:33 -0800 Message-Id: <445aeb081bc7131c0dcb0818f0326a8dd5a14a14.1544132474.git.horms+renesas@verge.net.au> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Geert Uytterhoeven Commit 59b89af1d5551c12 ("ARM: shmobile: sh7372: Remove Legacy C SoC code") removed the last user of the rmobile_pm_domain.resume() callback. Commit 44d88c754e57a6d9 ("ARM: shmobile: Remove legacy SoC code for R-Mobile A1") removed the last user of the rmobile_pm_domain.no_debug flag and of the "pm-rmobile.h" header file (outside the actual driver). Hence remove no longer used rmobile_pm_domain members, and absorb the header file into the driver. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/pm-rmobile.c | 37 ++++++++++++++++++------------------- arch/arm/mach-shmobile/pm-rmobile.h | 22 ---------------------- 2 files changed, 18 insertions(+), 41 deletions(-) delete mode 100644 arch/arm/mach-shmobile/pm-rmobile.h diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c index c6a11b5ec6db..421ae1c887d8 100644 --- a/arch/arm/mach-shmobile/pm-rmobile.c +++ b/arch/arm/mach-shmobile/pm-rmobile.c @@ -18,12 +18,11 @@ #include #include #include +#include #include #include -#include "pm-rmobile.h" - /* SYSC */ #define SPDCR 0x08 /* SYS Power Down Control Register */ #define SWUCR 0x14 /* SYS Wakeup Control Register */ @@ -32,6 +31,14 @@ #define PSTR_RETRIES 100 #define PSTR_DELAY_US 10 +struct rmobile_pm_domain { + struct generic_pm_domain genpd; + struct dev_power_governor *gov; + int (*suspend)(void); + void __iomem *base; + unsigned int bit_shift; +}; + static inline struct rmobile_pm_domain *to_rmobile_pd(struct generic_pm_domain *d) { @@ -65,16 +72,13 @@ static int rmobile_pd_power_down(struct generic_pm_domain *genpd) } } - if (!rmobile_pd->no_debug) - pr_debug("%s: Power off, 0x%08x -> PSTR = 0x%08x\n", - genpd->name, mask, - __raw_readl(rmobile_pd->base + PSTR)); + pr_debug("%s: Power off, 0x%08x -> PSTR = 0x%08x\n", genpd->name, mask, + __raw_readl(rmobile_pd->base + PSTR)); return 0; } -static int __rmobile_pd_power_up(struct rmobile_pm_domain *rmobile_pd, - bool do_resume) +static int __rmobile_pd_power_up(struct rmobile_pm_domain *rmobile_pd) { unsigned int mask; unsigned int retry_count; @@ -85,7 +89,7 @@ static int __rmobile_pd_power_up(struct rmobile_pm_domain *rmobile_pd, mask = BIT(rmobile_pd->bit_shift); if (__raw_readl(rmobile_pd->base + PSTR) & mask) - goto out; + return ret; __raw_writel(mask, rmobile_pd->base + SWUCR); @@ -100,21 +104,16 @@ static int __rmobile_pd_power_up(struct rmobile_pm_domain *rmobile_pd, if (!retry_count) ret = -EIO; - if (!rmobile_pd->no_debug) - pr_debug("%s: Power on, 0x%08x -> PSTR = 0x%08x\n", - rmobile_pd->genpd.name, mask, - __raw_readl(rmobile_pd->base + PSTR)); - -out: - if (ret == 0 && rmobile_pd->resume && do_resume) - rmobile_pd->resume(); + pr_debug("%s: Power on, 0x%08x -> PSTR = 0x%08x\n", + rmobile_pd->genpd.name, mask, + __raw_readl(rmobile_pd->base + PSTR)); return ret; } static int rmobile_pd_power_up(struct generic_pm_domain *genpd) { - return __rmobile_pd_power_up(to_rmobile_pd(genpd), true); + return __rmobile_pd_power_up(to_rmobile_pd(genpd)); } static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd) @@ -127,7 +126,7 @@ static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd) genpd->power_on = rmobile_pd_power_up; genpd->attach_dev = cpg_mstp_attach_dev; genpd->detach_dev = cpg_mstp_detach_dev; - __rmobile_pd_power_up(rmobile_pd, false); + __rmobile_pd_power_up(rmobile_pd); pm_genpd_init(genpd, gov ? : &simple_qos_governor, false); } diff --git a/arch/arm/mach-shmobile/pm-rmobile.h b/arch/arm/mach-shmobile/pm-rmobile.h deleted file mode 100644 index 69f839259b09..000000000000 --- a/arch/arm/mach-shmobile/pm-rmobile.h +++ /dev/null @@ -1,22 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 - * - * Copyright (C) 2012 Renesas Solutions Corp. - * - * Kuninori Morimoto - */ -#ifndef PM_RMOBILE_H -#define PM_RMOBILE_H - -#include - -struct rmobile_pm_domain { - struct generic_pm_domain genpd; - struct dev_power_governor *gov; - int (*suspend)(void); - void (*resume)(void); - void __iomem *base; - unsigned int bit_shift; - bool no_debug; -}; - -#endif /* PM_RMOBILE_H */