Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1628232

[PATCH 1/5] extcon: Allow extcon drivers to specify the extcon name

From Hans de Goede <hdegoede@redhat.com>
Newsgroups linux.kernel
Subject [PATCH 1/5] extcon: Allow extcon drivers to specify the extcon name
Date 2017-04-21 15:10 +0200
Message-ID <tyGtX-6d0-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


The parent device name is not necessarily always useful, e.g.
with i2c devices it may simply be e.g.: "0-0022" and it also depends
on the i2c-bus number which depends on probe ordering.

This commit allows drivers to set their own, more useful name,
avoiding the problems with some i2c-device names.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/extcon/extcon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index f422a78..f8d3c1b 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -1117,7 +1117,8 @@ int extcon_dev_register(struct extcon_dev *edev)
 	edev->dev.class = extcon_class;
 	edev->dev.release = extcon_dev_release;
 
-	edev->name = dev_name(edev->dev.parent);
+	if (!edev->name)
+		edev->name = dev_name(edev->dev.parent);
 	if (IS_ERR_OR_NULL(edev->name)) {
 		dev_err(&edev->dev,
 			"extcon device name is null\n");
-- 
2.9.3

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 1/5] extcon: Allow extcon drivers to specify the extcon name Hans de Goede <hdegoede@redhat.com> - 2017-04-21 15:10 +0200
  [PATCH 5/5] extcon: intel-cht-wc: Add support for monitoring external USB Type-C controller Hans de Goede <hdegoede@redhat.com> - 2017-04-21 15:10 +0200
    Re: [PATCH 5/5] extcon: intel-cht-wc: Add support for monitoring  external USB Type-C controller Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-04-21 21:00 +0200
    Re: [PATCH 5/5] extcon: intel-cht-wc: Add support for monitoring  external USB Type-C controller Heikki Krogerus <heikki.krogerus@linux.intel.com> - 2017-04-24 16:40 +0200

csiph-web