Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D66D2C07E96 for ; Tue, 6 Jul 2021 14:55:24 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B003611AE for ; Tue, 6 Jul 2021 14:55:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B003611AE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gerhold.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BB56882D7B; Tue, 6 Jul 2021 16:55:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gerhold.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gerhold.net header.i=@gerhold.net header.b="Zwd/xeXm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8F1B482D6F; Tue, 6 Jul 2021 16:55:07 +0200 (CEST) Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [85.215.255.51]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C18A782D1C for ; Tue, 6 Jul 2021 16:55:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gerhold.net Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=stephan@gerhold.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1625583294; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=vh5frXPl/75fKSbzojnmaaOgf//3pOfBt3tjh2ComgQ=; b=Zwd/xeXmy4+f1Lz12P1RH6fNVVQJuVTUnRCzy6mNG+H7hsBA6NwHJn7byJw4VKEDDW j3oJJtnnJKNKl0pSbpYAoaPhSn3HNEQtK10z5kz4+jmDnQIA4iVAUz16JSRmFwrNd1wL OygsGc+dZaRqd60x2kO7xbSUGx4mSKvQkT7xkJlMAUty1US5Jo3OfJJ1Mi4i9ohznvAx qGmta+diXpm8fqxYujSDq4yw4SvkGEY/F5ICZAPq146ps2PLQKl0+vACkojwc0dmU3np bW6TMUW0rKSAVMPs963RnWzWNxO1CwVxSTdutG//nuva0+vdqIgCDsDSXMcg0eEQNrPJ oLJQ== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB426NnXO3" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.28.1 DYNA|AUTH) with ESMTPSA id Y070ccx66EsrbL5 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 6 Jul 2021 16:54:53 +0200 (CEST) From: Stephan Gerhold To: u-boot@lists.denx.de Cc: Linus Walleij , Patrice Chotard , Stephan Gerhold , Jaehoon Chung , Peng Fan Subject: [PATCH 2/4] mmc: arm_pl180_mmci: Simplify code using dev_read_addr_ptr() Date: Tue, 6 Jul 2021 16:54:34 +0200 Message-Id: <20210706145436.165037-3-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210706145436.165037-1-stephan@gerhold.net> References: <20210706145436.165037-1-stephan@gerhold.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Simplify the code a bit by using dev_read_addr_ptr() instead of dev_read_addr(). This avoids having to cast explicitly to void*. Signed-off-by: Stephan Gerhold --- drivers/mmc/arm_pl180_mmci.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c index 5d1ee64356..e632eed03f 100644 --- a/drivers/mmc/arm_pl180_mmci.c +++ b/drivers/mmc/arm_pl180_mmci.c @@ -526,14 +526,11 @@ static const struct dm_mmc_ops arm_pl180_dm_mmc_ops = { static int arm_pl180_mmc_of_to_plat(struct udevice *dev) { struct pl180_mmc_host *host = dev_get_priv(dev); - fdt_addr_t addr; - addr = dev_read_addr(dev); - if (addr == FDT_ADDR_T_NONE) + host->base = dev_read_addr_ptr(dev); + if (!host->base) return -EINVAL; - host->base = (void *)addr; - return 0; } -- 2.32.0