From mboxrd@z Thu Jan 1 00:00:00 1970 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 3E61EC54EE9 for ; Thu, 22 Sep 2022 21:40:32 +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:Subject:Cc:To:From:Date:References: In-Reply-To:Message-Id:Mime-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XA4Ms3wRPNiX5sK+7zNdmXWC0RZ8v5P9+6zn61r21aY=; b=TQmgx/0gUmA0lT ZjyJjPEgLUK+daQC0CA7XcuAjAI33bPTH1vpYZEZqPumf0gWDbUk8ZgdE2Dn+YsUCDBIq2CZYPo6R SzmBr6JfGE3E1iB1vmtxsCcyyzxwEoUt6qkyzxwUMnk5ijER5tU50Yz9oLLD/ETETaz+1u0Q+uORx 1U8nLupJPKtpcDH++PlWaqqyVTfKsLrnDpgvM7zMQj2SWyZeqzsehVTEStXjnvcnr7azjg7t34H21 ESScLplJdYBrYUjvojz2SoM6xMe9OND7wileKLKO8q0ywuXI9Zv2/RfJourvyXP90It6RpnhKs+z/ 3zIluWdKetJ9igIa8u2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1obTuv-000LRY-16; Thu, 22 Sep 2022 21:39:33 +0000 Received: from new3-smtp.messagingengine.com ([66.111.4.229]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1obTus-000LQv-5m for linux-arm-kernel@lists.infradead.org; Thu, 22 Sep 2022 21:39:31 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 2A95C580C35; Thu, 22 Sep 2022 17:39:29 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute3.internal (MEProxy); Thu, 22 Sep 2022 17:39:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1663882769; x=1663886369; bh=rpJ5dLDrBG 4RU2npy0gA4zAAD6oKp0YoLCGtrhyhwEM=; b=e4zS8LqI3yZPrJ+kkUrj70ZFD4 pLzwXvjt8XarDbM7nDHjDrD7qKf+KoQ89l/2laVX9UfwOXPt3/YPUGWwXyMmMpDY 2XK4dwJwerK/r9FjarhLLJ2871v0hh/j/OEG4Ow+IsQgFC+Sn/7y+ybfiCK/JUCT W+0EXiKgYsqDF1r+yfmpdauELR4CTUn2CARYSL5LV00you2XTJBJZ2b7+jFh0raF ut63oi8KRVmnAXp9/pVbIfm8cAPEP4DygOPIQW8js1uCFrcpsXkiC3m5LEOilV19 eH+3BvPoyBjZTUNWBN6BRmQggu6BtzcGmvuwWxU3MF9WZPt03BMwdD+s0kBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1663882769; x=1663886369; bh=rpJ5dLDrBG4RU2npy0gA4zAAD6oK p0YoLCGtrhyhwEM=; b=dohe/pkCtrPN9juvk7SNrhiPPryqGHwv/LuY11IO2HYP P9UJUSIo0oGRPi9TTlZlevubxSpTYyd1nUJHHpqQghC7WXs7FEDry/zBif1kVWCI uSBOrLO9RBYEYsEbupgqrcAKecqApNzp/CSR1+AO2ksCP0fZB65Rr/KQQPfPzwCa 5R+DWCsiaay6e0+4OB8gtYqDJRdjCx4WEpQo6pQmvKrsfEKSGLBN2wYpWZZkW3B8 /JJM9JoEPCjyH5BaOtkTDbUpu1o1TLZ/cU2d1CDOs2gHD3Y0U5zTY7MJIU/1G9eS GQkvFOdSz7cmS0tAA0GqSpAYy4f8qZI3DnOlXz6nLw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeefhedgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 4ED65B60089; Thu, 22 Sep 2022 17:39:28 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-935-ge4ccd4c47b-fm-20220914.001-ge4ccd4c4 Mime-Version: 1.0 Message-Id: <89f85393-c767-4c0c-90db-d78a2927d465@www.fastmail.com> In-Reply-To: <20220922202458.7592-4-maukka@ext.kapsi.fi> References: <20220427162123.110458-1-maukka@ext.kapsi.fi> <20220922202458.7592-1-maukka@ext.kapsi.fi> <20220922202458.7592-4-maukka@ext.kapsi.fi> Date: Thu, 22 Sep 2022 23:39:07 +0200 From: "Arnd Bergmann" To: "Mauri Sandberg" , "Rob Herring" , krzysztof.kozlowski+dt@linaro.org, "Olof Johansson" , "Andrew Lunn" , "Sebastian Hesselbarth" , "Gregory Clement" , "Russell King" Cc: =?UTF-8?Q?Pali_Roh=C3=A1r?= , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 3/3] ARM: orion5x: Add D-Link DNS-323 based on Device Tree X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220922_143930_304684_FEE2F5E8 X-CRM114-Status: GOOD ( 16.55 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Sep 22, 2022, at 10:24 PM, Mauri Sandberg wrote: > + > +/* dns323_parse_hex_*() taken from tsx09-common.c; should a common > copy of these > + * functions be kept somewhere? > + */ > +static int __init dns323_parse_hex_nibble(char n) > +{ > + if (n >= '0' && n <= '9') > + return n - '0'; > + > + if (n >= 'A' && n <= 'F') > + return n - 'A' + 10; > + > + if (n >= 'a' && n <= 'f') > + return n - 'a' + 10; > + > + return -1; > +} > + > +static int __init dns323_parse_hex_byte(const char *b) > +{ > + int hi; > + int lo; > + > + hi = dns323_parse_hex_nibble(b[0]); > + lo = dns323_parse_hex_nibble(b[1]); > + > + if (hi < 0 || lo < 0) > + return -1; > + > + return (hi << 4) | lo; > +} > + Can you use simple_strntoull() to parse the address into a u64 instead? > +static int __init dns323_read_mac_addr(u8 *addr) > +{ > + int i; > + char *mac_page; > + > + /* MAC address is stored as a regular ol' string in /dev/mtdblock4 > + * (0x007d0000-0x00800000) starting at offset 196480 (0x2ff80). > + */ > + mac_page = ioremap(DNS323_NOR_BOOT_BASE + 0x7d0000 + 196480, 1024); > + if (!mac_page) > + return -ENOMEM; It would be nicer to use of_iomap() on the nor device than a hardcoded physical address here, at least if that doesn't add too much extra complexity. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel