lkml.org 
[lkml]   [2023]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v1 06/14] extcon: Allow name to be assigned outside of the framework
    Date
    The documentation states that name of the extcon can be assigned
    outside of the framework, however code does something different.
    Fix the code to be aligned with the documentation.

    Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    ---
    drivers/extcon/extcon.c | 8 ++++----
    1 file changed, 4 insertions(+), 4 deletions(-)

    diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
    index ac84f4aafc69..14e66e21597f 100644
    --- a/drivers/extcon/extcon.c
    +++ b/drivers/extcon/extcon.c
    @@ -1269,10 +1269,10 @@ 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 (IS_ERR_OR_NULL(edev->name)) {
    - dev_err(&edev->dev,
    - "extcon device name is null\n");
    + if (!edev->name)
    + edev->name = dev_name(edev->dev.parent);
    + if (!edev->name) {
    + dev_err(&edev->dev, "extcon device name is null\n");
    return -EINVAL;
    }
    dev_set_name(&edev->dev, "extcon%lu",
    --
    2.40.0.1.gaa8946217a0b
    \
     
     \ /
      Last update: 2023-03-27 01:12    [W:4.040 / U:0.344 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site