All of lore.kernel.org
 help / color / mirror / Atom feed
From: hare@suse.de (Hannes Reinecke)
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH 6/8] Fix spi initialisation failure
Date: Tue, 18 Mar 2008 14:32:28 +0100	[thread overview]
Message-ID: <20080318133228.6DFD9159159@pentland.suse.de> (raw)


With the target rework we cannot set the attribute of the
sysfs files as the sysfs object is not registered yet. So
just modify the attribute itself.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/scsi/scsi_transport_spi.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index bc12b5d..4f9c98c 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -1473,13 +1473,13 @@ static int spi_target_configure(struct transport_container *tc,
 		 * to ignore, sysfs also does a WARN_ON and dumps a trace,
 		 * which is bad, so temporarily, skip attributes that are
 		 * already visible (the revalidate one) */
-		if (j && attr != &dev_attr_revalidate.attr)
+		if (j && attr != &dev_attr_revalidate.attr) {
+			if ((j & 1))
+				attr->mode |= S_IWUSR;
+
 			rc = sysfs_add_file_to_group(kobj, attr,
 						target_attribute_group.name);
-		/* and make the attribute writeable if we have a set
-		 * function */
-		if ((j & 1))
-			rc = sysfs_chmod_file(kobj, attr, attr->mode | S_IWUSR);
+		}
 	}
 
 	return 0;
-- 
1.5.2.4


             reply	other threads:[~2008-03-18 13:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-18 13:32 Hannes Reinecke [this message]
2008-03-18 14:39 ` [PATCH 6/8] Fix spi initialisation failure James Bottomley
     [not found]   ` <47DFE20A.7090503@suse.de>
2008-03-18 16:13     ` James Bottomley
2008-03-21 21:15 ` James Bottomley

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=20080318133228.6DFD9159159@pentland.suse.de \
    --to=hare@suse.de \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-scsi@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.