mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@suse.de>
To: linux-kernel@vger.kernel.org
Cc: Kay Sievers <kay.sievers@vrfy.org>,
	Larry Finger <Larry.Finger@lwfinger.net>,
	David Miller <davem@davemloft.net>,
	"Rafael J. Wysocki" <rjw@sisk.pl>, Tejun Heo <htejun@gmail.com>,
	Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 4/6] Driver Core: fix bug in device_rename() for SYSFS_DEPRECATED=y
Date: Tue, 30 Oct 2007 22:11:43 -0700	[thread overview]
Message-ID: <1193807505-3821-4-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <1193807505-3821-3-git-send-email-gregkh@suse.de>

From: Kay Sievers <kay.sievers@vrfy.org>

This should fix the sysfs warnings that renaming network devices is
causing to show up with CONFIG_SYSFS_DEPRECATED=y

The code just shouldn't run if class devices are real directories, it's
an update for the symlink in the class directory. Nobody noticed that as
long as the creation of sysfs files silently failed, and we both missed
it before the merge, because we don't run SYSFS_DEPRECATED=y.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: David Miller <davem@davemloft.net>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/core.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index c134341..3f4d6aa 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1228,18 +1228,18 @@ int device_rename(struct device *dev, char *new_name)
 			sysfs_remove_link(&dev->parent->kobj, old_class_name);
 		}
 	}
-#endif
-
+#else
 	if (dev->class) {
 		sysfs_remove_link(&dev->class->subsys.kobj, old_device_name);
 		error = sysfs_create_link(&dev->class->subsys.kobj, &dev->kobj,
 					  dev->bus_id);
 		if (error) {
-			/* Uh... how to unravel this if restoring can fail? */
 			dev_err(dev, "%s: sysfs_create_symlink failed (%d)\n",
 				__FUNCTION__, error);
 		}
 	}
+#endif
+
 out:
 	put_device(dev);
 
-- 
1.5.3.4


  reply	other threads:[~2007-10-31  5:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-31  5:09 [GIT PATCH] driver core fixes for 2.6.24-rc1 Greg KH
2007-10-31  5:11 ` [PATCH 1/6] Driver core: remove class_device_*_bin_file Greg Kroah-Hartman
2007-10-31  5:11   ` [PATCH 2/6] kobject: check for duplicate names in kobject_rename Greg Kroah-Hartman
2007-10-31  5:11     ` [PATCH 3/6] sysfs: make sysfs_{get,put}_active() static Greg Kroah-Hartman
2007-10-31  5:11       ` Greg Kroah-Hartman [this message]
2007-10-31  5:11         ` [PATCH 5/6] fix typo in SubmittingPatches Greg Kroah-Hartman
2007-10-31  5:11           ` [PATCH 6/6] add SubmittingPatches to Documentation/ja_JP Greg Kroah-Hartman
2007-10-31  9:17           ` [PATCH 5/6] fix typo in SubmittingPatches Andy Whitcroft
2007-10-31 17:26   ` [PATCH 1/6] Driver core: remove class_device_*_bin_file Tony Luck
2007-10-31 18:44     ` Greg KH

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=1193807505-3821-4-git-send-email-gregkh@suse.de \
    --to=gregkh@suse.de \
    --cc=Larry.Finger@lwfinger.net \
    --cc=davem@davemloft.net \
    --cc=htejun@gmail.com \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    /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

Powered by JetHome