aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/extcon/extcon-class.c
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2013-09-26 20:20:26 -0400
committerChanwoo Choi <cw00.choi@samsung.com>2013-09-26 20:37:01 -0400
commit42d7d7539a7bcf1d493b989465283c464f4a0525 (patch)
treea62b2043514378cabaf629b865612e5019ff29e4 /drivers/extcon/extcon-class.c
parentdae616512476024aa61d2a598461ab6eff8c0709 (diff)
extcon: Simplify extcon_dev_register() prototype by removing unnecessary parameter
This patch remove extcon_dev_register()'s second parameter which means the pointer of parent device to simplify prototype of this function. So, if extcon device has the parent device, it should set the pointer of parent device to edev.dev.parent in extcon device driver instead of in extcon_dev_register(). Cc: Graeme Gregory <gg@slimlogic.co.uk> Cc: Kishon Vijay Abraham I <kishon@ti.com> Cc: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Cc: Mark Brown <broonie@kernel.org> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'drivers/extcon/extcon-class.c')
-rw-r--r--drivers/extcon/extcon-class.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/extcon/extcon-class.c b/drivers/extcon/extcon-class.c
index 2801c14d5232..84902d3fee11 100644
--- a/drivers/extcon/extcon-class.c
+++ b/drivers/extcon/extcon-class.c
@@ -566,14 +566,13 @@ static void dummy_sysfs_dev_release(struct device *dev)
566/** 566/**
567 * extcon_dev_register() - Register a new extcon device 567 * extcon_dev_register() - Register a new extcon device
568 * @edev : the new extcon device (should be allocated before calling) 568 * @edev : the new extcon device (should be allocated before calling)
569 * @dev : the parent device for this extcon device.
570 * 569 *
571 * Among the members of edev struct, please set the "user initializing data" 570 * Among the members of edev struct, please set the "user initializing data"
572 * in any case and set the "optional callbacks" if required. However, please 571 * in any case and set the "optional callbacks" if required. However, please
573 * do not set the values of "internal data", which are initialized by 572 * do not set the values of "internal data", which are initialized by
574 * this function. 573 * this function.
575 */ 574 */
576int extcon_dev_register(struct extcon_dev *edev, struct device *dev) 575int extcon_dev_register(struct extcon_dev *edev)
577{ 576{
578 int ret, index = 0; 577 int ret, index = 0;
579 578
@@ -597,11 +596,15 @@ int extcon_dev_register(struct extcon_dev *edev, struct device *dev)
597 return -EINVAL; 596 return -EINVAL;
598 } 597 }
599 598
600 edev->dev.parent = dev;
601 edev->dev.class = extcon_class; 599 edev->dev.class = extcon_class;
602 edev->dev.release = extcon_dev_release; 600 edev->dev.release = extcon_dev_release;
603 601
604 edev->name = edev->name ? edev->name : dev_name(dev); 602 edev->name = edev->name ? edev->name : dev_name(edev->dev.parent);
603 if (IS_ERR_OR_NULL(edev->name)) {
604 dev_err(&edev->dev,
605 "extcon device name is null\n");
606 return -EINVAL;
607 }
605 dev_set_name(&edev->dev, "%s", edev->name); 608 dev_set_name(&edev->dev, "%s", edev->name);
606 609
607 if (edev->max_supported) { 610 if (edev->max_supported) {