From patchwork Fri Jun 9 14:39:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 13274047 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 BE90EC7EE2E for ; Fri, 9 Jun 2023 14:39:48 +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=jArwjkdw7RfihfYY05lf725T2ltcg7K1SvQa9kAkf3Y=; b=wfnazEI7AvqRIa oHYjoDaa0TIeuLK9r4cFWonurT8omc+vMWRfZomCWEr2p4vC+MemoXdzLnI5P7L4cB0WPDU9hXvSm 57OKSKCTdSQBIdeBPIE848FA7c7yj/Bu+ilcfvuLYbTEVJtv1uwMKGekUFKCb8tCaSoEugePpWsyT NVFlsBGrOW6rRkxUI+rDKvHGgGiJiFM5leJtWDWXF2Rdv19FWfe4j/dgdpfobsL8yLGcrWB0aacnn rVWnEZ0I5PvLrnnmm2gLInuzZqTz+dcOTmdsEyX+jH6/qQYSnewo8sLJ5cUi4QIawcmZo0RVYkYZi PqpZ+vmqgHtNW19nMAjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7dGu-00DIDx-37; Fri, 09 Jun 2023 14:39:24 +0000 Received: from relay3-d.mail.gandi.net ([2001:4b98:dc4:8::223]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7dGr-00DIBg-2j for linux-arm-kernel@lists.infradead.org; Fri, 09 Jun 2023 14:39:23 +0000 X-GND-Sasl: miquel.raynal@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1686321556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EFPA+iF1oDnlDYWPONEIrlc2JlsGAiwXm8sKilpLnOk=; b=pZ1jNqjSB01eYJK+iVJNl1WJucinc7z4V/+U4lwOOQ7cEr1056xU3pB8wk1R2R4FcYPGr9 baOzltFc4Al22YTf8cmCrOzjkCILsbE4hxLM3+bzv4qWznAs4sH8IzkKxFKjEwdJcmhUbt TerWuex0XSyP+IP5PxjwAhK60e9FWkXz4WR8RiHQzCWnZ/GM/vhq1wtcHegOB5gB7IPa+8 ZDpanMlbzoe3U59GSJfCNxzi9+gcp3a4lljxbn1QwMUl4+kL3dzu0AfsOH95uSBl3jJYUY HYl9d7+L5mvNd5vwhMe7N/9Dc9gcGpBANr9/9RfWu9bXOm5VhXtg+2P+rCaBYg== X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 3D9B56000A; Fri, 9 Jun 2023 14:39:15 +0000 (UTC) From: Miquel Raynal To: Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Cc: , , linux-pm@vger.kernel.org, Thomas Petazzoni , Miquel Raynal Subject: [PATCH 1/2] power: reset: at91-reset: use driver structure as status parameter Date: Fri, 9 Jun 2023 16:39:11 +0200 Message-Id: <20230609143912.849995-2-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230609143912.849995-1-miquel.raynal@bootlin.com> References: <20230609143912.849995-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230609_073922_182049_C233CC88 X-CRM114-Status: UNSURE ( 9.88 ) X-CRM114-Notice: Please train this message. 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 It is quite uncommon to use a driver helper with parameters like *pdev and __iomem *base. It is much cleaner and close to today's standards to provide the per-device driver structure and then access its internals. Let's do this with at91_resete_status() before making more modifications to this helper. Signed-off-by: Miquel Raynal --- drivers/power/reset/at91-reset.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/power/reset/at91-reset.c b/drivers/power/reset/at91-reset.c index 741e44a017c3..a8a6f3997768 100644 --- a/drivers/power/reset/at91-reset.c +++ b/drivers/power/reset/at91-reset.c @@ -149,11 +149,10 @@ static int at91_reset(struct notifier_block *this, unsigned long mode, return NOTIFY_DONE; } -static void __init at91_reset_status(struct platform_device *pdev, - void __iomem *base) +static void __init at91_reset_status(struct at91_reset *reset) { + u32 reg = readl(reset->rstc_base + AT91_RSTC_SR); const char *reason; - u32 reg = readl(base + AT91_RSTC_SR); switch ((reg & AT91_RSTC_RSTTYP) >> 8) { case RESET_TYPE_GENERAL: