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 83FF7C11F68 for ; Fri, 2 Jul 2021 16:00:29 +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 2F96A613F3 for ; Fri, 2 Jul 2021 16:00:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2F96A613F3 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 C1B2A81019; Fri, 2 Jul 2021 18:00:25 +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="pXdjjqCZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 428D8814A4; Fri, 2 Jul 2021 18:00:23 +0200 (CEST) Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [85.215.255.53]) (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 A7D2D80C70 for ; Fri, 2 Jul 2021 18:00:20 +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=1625241619; s=strato-dkim-0002; d=gerhold.net; h=Message-Id:Date:Subject:Cc:To:From:Cc:Date:From:Subject:Sender; bh=49K4jpWguqU1bgo0EpcQVaTQMIPnh2iEipTcFhMbBd4=; b=pXdjjqCZUmZUr+IocS/QnjW/clUa64WecxDr8olwmTWAGwRYn4XTM9FcMq2FEvnAJN vCjDyNIFZodPygn4jAGPIecNMSEQdzk/1T4/LHTIKBDhuUAMArnK6Vc1rxXiX6pqaVl5 4wyZ9X4XxQhnecVIJgg8pw+Bp7MOy7wHphpOBBmSgqeeJ5squWwDF3Hol9q7Mv8axrLD HmA20c2JnqJ7WJDJtg56GX3JjQ3vZ7h250ZqVlVyeTLbv9KXAy8qzPk92OzxLPcfxgnS sGcKYJaQb3iCS0qEmUI8yAwc468WOYyKkMkGR/Gtk5knRzOoqmd41x/XgNAJi+/JiNxi TDiA== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxO4W6NNuQy" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.28.1 DYNA|AUTH) with ESMTPSA id Y070ccx62G0JG6J (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 2 Jul 2021 18:00:19 +0200 (CEST) From: Stephan Gerhold To: u-boot@lists.denx.de Cc: Stephan Gerhold , Linus Walleij Subject: [PATCH] timer: nomadik-mtu: Use dev_read_addr_ptr() Date: Fri, 2 Jul 2021 18:00:13 +0200 Message-Id: <20210702160013.89038-1-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 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 the struct nomadik_mtu_regs. Signed-off-by: Stephan Gerhold --- drivers/timer/nomadik-mtu-timer.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/timer/nomadik-mtu-timer.c b/drivers/timer/nomadik-mtu-timer.c index 417b419d46..4d24de14ae 100644 --- a/drivers/timer/nomadik-mtu-timer.c +++ b/drivers/timer/nomadik-mtu-timer.c @@ -67,14 +67,11 @@ static int nomadik_mtu_probe(struct udevice *dev) struct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev); struct nomadik_mtu_priv *priv = dev_get_priv(dev); struct nomadik_mtu_regs *mtu; - fdt_addr_t addr; u32 prescale; - addr = dev_read_addr(dev); - if (addr == FDT_ADDR_T_NONE) + mtu = dev_read_addr_ptr(dev); + if (!mtu) return -EINVAL; - - mtu = (struct nomadik_mtu_regs *)addr; priv->timer = mtu->timers; /* Use first timer */ if (!uc_priv->clock_rate) -- 2.32.0