From patchwork Tue Oct 25 03:12:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yingliang X-Patchwork-Id: 13018436 X-Patchwork-Delegate: kuba@kernel.org 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 EFB2EC67871 for ; Tue, 25 Oct 2022 03:13:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230374AbiJYDNb (ORCPT ); Mon, 24 Oct 2022 23:13:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230183AbiJYDN3 (ORCPT ); Mon, 24 Oct 2022 23:13:29 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34CE21B9D3 for ; Mon, 24 Oct 2022 20:13:28 -0700 (PDT) Received: from dggpemm500024.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MxH4x1mpPzJn9v; Tue, 25 Oct 2022 11:10:41 +0800 (CST) Received: from dggpemm500007.china.huawei.com (7.185.36.183) by dggpemm500024.china.huawei.com (7.185.36.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 11:13:26 +0800 Received: from huawei.com (10.175.103.91) by dggpemm500007.china.huawei.com (7.185.36.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 11:13:26 +0800 From: Yang Yingliang To: CC: , Subject: [PATCH net-next 1/2] net: natsemi: xtsonic: switch to use platform_get_irq() Date: Tue, 25 Oct 2022 11:12:35 +0800 Message-ID: <20221025031236.1031330-1-yangyingliang@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500007.china.huawei.com (7.185.36.183) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Switch to use platform_get_irq() which supports more cases. Signed-off-by: Yang Yingliang --- drivers/net/ethernet/natsemi/xtsonic.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/natsemi/xtsonic.c b/drivers/net/ethernet/natsemi/xtsonic.c index 52fef34d43f9..ffb3814c54cb 100644 --- a/drivers/net/ethernet/natsemi/xtsonic.c +++ b/drivers/net/ethernet/natsemi/xtsonic.c @@ -201,14 +201,17 @@ int xtsonic_probe(struct platform_device *pdev) { struct net_device *dev; struct sonic_local *lp; - struct resource *resmem, *resirq; + struct resource *resmem; + int irq; int err = 0; if ((resmem = platform_get_resource(pdev, IORESOURCE_MEM, 0)) == NULL) return -ENODEV; - if ((resirq = platform_get_resource(pdev, IORESOURCE_IRQ, 0)) == NULL) - return -ENODEV; + irq = platform_get_irq(pdev, 0); + if (irq < 0) + return irq; + if ((dev = alloc_etherdev(sizeof(struct sonic_local))) == NULL) return -ENOMEM; @@ -219,7 +222,7 @@ int xtsonic_probe(struct platform_device *pdev) SET_NETDEV_DEV(dev, &pdev->dev); dev->base_addr = resmem->start; - dev->irq = resirq->start; + dev->irq = irq; if ((err = sonic_probe1(dev))) goto out; From patchwork Tue Oct 25 03:12:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yingliang X-Patchwork-Id: 13018435 X-Patchwork-Delegate: kuba@kernel.org 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 A0C89C38A2D for ; Tue, 25 Oct 2022 03:13:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230211AbiJYDNa (ORCPT ); Mon, 24 Oct 2022 23:13:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229689AbiJYDN3 (ORCPT ); Mon, 24 Oct 2022 23:13:29 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FD7F2F647 for ; Mon, 24 Oct 2022 20:13:28 -0700 (PDT) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MxH2W4gdxz15M3Q; Tue, 25 Oct 2022 11:08:35 +0800 (CST) Received: from dggpemm500007.china.huawei.com (7.185.36.183) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 11:13:26 +0800 Received: from huawei.com (10.175.103.91) by dggpemm500007.china.huawei.com (7.185.36.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 11:13:26 +0800 From: Yang Yingliang To: CC: , Subject: [PATCH net-next 2/2] net: natsemi: xtsonic: use pr_err() Date: Tue, 25 Oct 2022 11:12:36 +0800 Message-ID: <20221025031236.1031330-2-yangyingliang@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221025031236.1031330-1-yangyingliang@huawei.com> References: <20221025031236.1031330-1-yangyingliang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500007.china.huawei.com (7.185.36.183) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Use pr_err() instead of printk(KERN_ERR ...). Signed-off-by: Yang Yingliang --- drivers/net/ethernet/natsemi/xtsonic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/natsemi/xtsonic.c b/drivers/net/ethernet/natsemi/xtsonic.c index ffb3814c54cb..a31a67edc58c 100644 --- a/drivers/net/ethernet/natsemi/xtsonic.c +++ b/drivers/net/ethernet/natsemi/xtsonic.c @@ -90,7 +90,7 @@ static int xtsonic_open(struct net_device *dev) retval = request_irq(dev->irq, sonic_interrupt, 0, "sonic", dev); if (retval) { - printk(KERN_ERR "%s: unable to get IRQ %d.\n", + pr_err("%s: unable to get IRQ %d.\n", dev->name, dev->irq); return -EAGAIN; }