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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF47EC77B7A for ; Sat, 3 Jun 2023 20:30:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231285AbjFCUad (ORCPT ); Sat, 3 Jun 2023 16:30:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229463AbjFCUab (ORCPT ); Sat, 3 Jun 2023 16:30:31 -0400 Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFA0F12E for ; Sat, 3 Jun 2023 13:30:30 -0700 (PDT) Received: from localhost (88-113-26-95.elisa-laajakaista.fi [88.113.26.95]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id 7a2b1d70-024d-11ee-b972-005056bdfda7; Sat, 03 Jun 2023 23:30:28 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Sat, 3 Jun 2023 23:30:27 +0300 To: Nikita Shubin Cc: Alexander Sverdlin , Arnd Bergmann , Linus Walleij , Hartley Sweeten , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Michael Peters , Kris Bahnsen , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v1 20/43] net: cirrus: add DT support for Cirrus EP93xx Message-ID: References: <20230424123522.18302-1-nikita.shubin@maquefel.me> <20230601054549.10843-2-nikita.shubin@maquefel.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230601054549.10843-2-nikita.shubin@maquefel.me> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thu, Jun 01, 2023 at 08:45:25AM +0300, Nikita Shubin kirjoitti: > - find register range from the device tree > - get "copy_addr" from the device tree > - get phy_id from the device tree ... > -#include > #include > +#include Stray change. ... > mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); > irq = platform_get_irq(pdev, 0); > if (!mem || irq < 0) > return -ENXIO; > > - dev = ep93xx_dev_alloc(data); > + base_addr = ioremap(mem->start, resource_size(mem)); > + if (!base_addr) { > + dev_err(&pdev->dev, "Failed to ioremap ethernet registers\n"); > + return -EIO; > + } Why not switching to devm_platform_ioremap_resource()? ... > + if (of_property_read_u32(np, "reg", &phy_id)) { > + dev_err(&pdev->dev, "Failed to locate \"phy_id\"\n"); > + return -ENOENT; return dev_err_probe(...); ? > + } -- With Best Regards, Andy Shevchenko 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 F12C1C7EE24 for ; Sat, 3 Jun 2023 20:31:04 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rB9UriayCp+w4lVHz2JNcSRrqax+FGJhZLNlePpvai8=; b=vOQ2X5t8kQ75U7 TQJjy62Ic3/h22d3OgWegLvG2gnArOKeIykAVVy873URUYbR4CI7FXTMqOcwZbCjYykV6vuYXDmBk bohSrKMwoJ8ZEeMNgbEfI6ttmvgaKM2KE2Ixkp9ACC4AICykoMqZo7DZMwj9jfr1R7Th9G9wNB8iw roE257Vempelv0I2/xacmUtb0aj67ClnakkHLl12+sFnW8GOXSAnqwdg33qkzQIUESm06zuxI/P/I 4afTBTdcZV7wPYuZqOssnB9bLI+Jc1x6DGJk5CtyhA8XFtiNOK9xa31RVZj61r2IoxB9de0zbMVDT rRo1m/2yz5Xln9gFnQhA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q5XtR-00AX0i-2G; Sat, 03 Jun 2023 20:30:33 +0000 Received: from fgw23-7.mail.saunalahti.fi ([62.142.5.84]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q5XtO-00AX06-28 for linux-arm-kernel@lists.infradead.org; Sat, 03 Jun 2023 20:30:32 +0000 Received: from localhost (88-113-26-95.elisa-laajakaista.fi [88.113.26.95]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id 7a2b1d70-024d-11ee-b972-005056bdfda7; Sat, 03 Jun 2023 23:30:28 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Sat, 3 Jun 2023 23:30:27 +0300 To: Nikita Shubin Cc: Alexander Sverdlin , Arnd Bergmann , Linus Walleij , Hartley Sweeten , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Michael Peters , Kris Bahnsen , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v1 20/43] net: cirrus: add DT support for Cirrus EP93xx Message-ID: References: <20230424123522.18302-1-nikita.shubin@maquefel.me> <20230601054549.10843-2-nikita.shubin@maquefel.me> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230601054549.10843-2-nikita.shubin@maquefel.me> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230603_133030_879468_7B1B2F12 X-CRM114-Status: GOOD ( 10.51 ) 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 Thu, Jun 01, 2023 at 08:45:25AM +0300, Nikita Shubin kirjoitti: > - find register range from the device tree > - get "copy_addr" from the device tree > - get phy_id from the device tree ... > -#include > #include > +#include Stray change. ... > mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); > irq = platform_get_irq(pdev, 0); > if (!mem || irq < 0) > return -ENXIO; > > - dev = ep93xx_dev_alloc(data); > + base_addr = ioremap(mem->start, resource_size(mem)); > + if (!base_addr) { > + dev_err(&pdev->dev, "Failed to ioremap ethernet registers\n"); > + return -EIO; > + } Why not switching to devm_platform_ioremap_resource()? ... > + if (of_property_read_u32(np, "reg", &phy_id)) { > + dev_err(&pdev->dev, "Failed to locate \"phy_id\"\n"); > + return -ENOENT; return dev_err_probe(...); ? > + } -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel