linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yang Yingliang <yangyingliang@huawei.com>
To: <linux-kernel@vger.kernel.org>, <linux-xtensa@linux-xtensa.org>
Cc: <chris@zankel.net>, <jcmvbkbc@gmail.com>
Subject: [PATCH -next 2/2] xtensa: iss: change the return type of iss_net_configure() to void
Date: Tue, 5 Jul 2022 21:20:32 +0800	[thread overview]
Message-ID: <20220705132032.702972-2-yangyingliang@huawei.com> (raw)
In-Reply-To: <20220705132032.702972-1-yangyingliang@huawei.com>

Change the return type of iss_net_configure() to void, because it's not used.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 arch/xtensa/platforms/iss/network.c | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/arch/xtensa/platforms/iss/network.c b/arch/xtensa/platforms/iss/network.c
index 5e475f7472e4..e38ff51ce833 100644
--- a/arch/xtensa/platforms/iss/network.c
+++ b/arch/xtensa/platforms/iss/network.c
@@ -472,16 +472,15 @@ static const struct net_device_ops iss_netdev_ops = {
 	.ndo_set_rx_mode	= iss_net_set_multicast_list,
 };
 
-static int iss_net_configure(int index, char *init)
+static void iss_net_configure(int index, char *init)
 {
 	struct net_device *dev;
 	struct iss_net_private *lp;
-	int err;
 
 	dev = alloc_etherdev(sizeof(*lp));
 	if (dev == NULL) {
 		pr_err("eth_configure: failed to allocate device\n");
-		return -ENOMEM;
+		return;
 	}
 
 	/* Initialize private element. */
@@ -509,7 +508,6 @@ static int iss_net_configure(int index, char *init)
 	if (!tuntap_probe(lp, index, init)) {
 		pr_err("%s: invalid arguments. Skipping device!\n",
 		       dev->name);
-		err = -EINVAL;
 		goto err_free_netdev;
 	}
 
@@ -518,8 +516,7 @@ static int iss_net_configure(int index, char *init)
 	/* sysfs register */
 
 	if (!driver_registered) {
-		err = platform_driver_register(&iss_net_driver);
-		if (err)
+		if (platform_driver_register(&iss_net_driver))
 			goto err_free_netdev;
 		driver_registered = 1;
 	}
@@ -530,8 +527,7 @@ static int iss_net_configure(int index, char *init)
 
 	lp->pdev.id = index;
 	lp->pdev.name = DRIVER_NAME;
-	err = platform_device_register(&lp->pdev);
-	if (err)
+	if (platform_device_register(&lp->pdev))
 		goto err_free_netdev;
 	SET_NETDEV_DEV(dev, &lp->pdev.dev);
 
@@ -541,23 +537,22 @@ static int iss_net_configure(int index, char *init)
 	dev->irq = -1;
 
 	rtnl_lock();
-	err = register_netdevice(dev);
-	rtnl_unlock();
-
-	if (err) {
+	if (register_netdevice(dev)) {
+		rtnl_unlock();
 		pr_err("%s: error registering net device!\n", dev->name);
 		goto err_unregister_device;
 	}
+	rtnl_unlock();
 
 	timer_setup(&lp->tl, iss_net_user_timer_expire, 0);
 
-	return 0;
+	return;
 
 err_unregister_device:
 	platform_device_unregister(&lp->pdev);
 err_free_netdev:
 	free_netdev(dev);
-	return err;
+	return;
 }
 
 /* ------------------------------------------------------------------------- */
-- 
2.25.1


  reply	other threads:[~2022-07-05 13:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-05 13:20 [PATCH -next 1/2] xtensa: iss: fix handling error cases in iss_net_configure() Yang Yingliang
2022-07-05 13:20 ` Yang Yingliang [this message]
2022-07-05 15:59   ` [PATCH -next 2/2] xtensa: iss: change the return type of iss_net_configure() to void Max Filippov
2022-07-06  1:33     ` Yang Yingliang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220705132032.702972-2-yangyingliang@huawei.com \
    --to=yangyingliang@huawei.com \
    --cc=chris@zankel.net \
    --cc=jcmvbkbc@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xtensa@linux-xtensa.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).