netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ursula Braun <ursula.braun@de.ibm.com>
To: davem@davemloft.net, netdev@vger.kernel.org, linux-s390@vger.kernel.org
Cc: schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com,
	Klaus-Dieter Wacker <kdwacker@de.ibm.com>,
	Ursula Braun <ursula.braun@de.ibm.com>
Subject: [patch 4/5] [PATCH] lcs: Recognize return codes of ccw_device_set_online().
Date: Thu, 15 Oct 2009 10:54:58 +0200	[thread overview]
Message-ID: <20091015090749.898475000@linux.vnet.ibm.com> (raw)
In-Reply-To: 20091015085454.124154000@linux.vnet.ibm.com

[-- Attachment #1: 611-lcs-set_online-rc.diff --]
[-- Type: text/plain, Size: 1385 bytes --]

From: Klaus-Dieter Wacker <kdwacker@de.ibm.com>

The creation of a new lcs device requires a call to the function
ccw_device_set_online() for the read and the write channel. Failure
of either call should terminate the lcs device creation immediately
with return code -ENODEV.

Signed-off-by: Klaus-Dieter Wacker <kdwacker@de.ibm.com>
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
---

 drivers/s390/net/lcs.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff -urpN linux-2.6/drivers/s390/net/lcs.c linux-2.6-patched/drivers/s390/net/lcs.c
--- linux-2.6/drivers/s390/net/lcs.c	2009-10-15 10:19:52.000000000 +0200
+++ linux-2.6-patched/drivers/s390/net/lcs.c	2009-10-15 10:19:52.000000000 +0200
@@ -2130,8 +2130,12 @@ lcs_new_device(struct ccwgroup_device *c
 	card->write.ccwdev = ccwgdev->cdev[1];
 
 	recover_state = card->state;
-	ccw_device_set_online(card->read.ccwdev);
-	ccw_device_set_online(card->write.ccwdev);
+	rc = ccw_device_set_online(card->read.ccwdev);
+	if (rc)
+		goto out_err;
+	rc = ccw_device_set_online(card->write.ccwdev);
+	if (rc)
+		goto out_werr;
 
 	LCS_DBF_TEXT(3, setup, "lcsnewdv");
 
@@ -2210,8 +2214,10 @@ netdev_out:
 	return 0;
 out:
 
-	ccw_device_set_offline(card->read.ccwdev);
 	ccw_device_set_offline(card->write.ccwdev);
+out_werr:
+	ccw_device_set_offline(card->read.ccwdev);
+out_err:
 	return -ENODEV;
 }
 


  parent reply	other threads:[~2009-10-15  9:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-15  8:54 [patch 0/5] s390: networking patches for linux-next Ursula Braun
2009-10-15  8:54 ` [patch 1/5] [PATCH] af_iucv: use sk functions to modify sk->sk_ack_backlog Ursula Braun
2009-10-15  8:54 ` [patch 2/5] [PATCH] af_iucv: remove duplicate sock_set_flag Ursula Braun
2009-10-15  8:54 ` [patch 3/5] [PATCH] lcs: ODEBUG: object is on stack, but not annotated Ursula Braun
2009-10-15  8:54 ` Ursula Braun [this message]
2009-10-15  8:54 ` [patch 5/5] [PATCH] ctcm rollback in case of errors Ursula Braun
2009-10-18  6:57 ` [patch 0/5] s390: networking patches for linux-next David Miller

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=20091015090749.898475000@linux.vnet.ibm.com \
    --to=ursula.braun@de.ibm.com \
    --cc=davem@davemloft.net \
    --cc=heiko.carstens@de.ibm.com \
    --cc=kdwacker@de.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    /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).