lkml.org 
[lkml]   [2023]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRE: [PATCH 3/4] extcon: added extcon_alloc_muex to simplify extcon register function
    From
    Date
    >--------- Original Message ---------
    >Sender : 이범우 <bw365.lee@samsung.com>Product S/W Lab(VD)/삼성전자
    >Date : 2023-02-17 17:48 (GMT+9)
    >Title : [PATCH 3/4] extcon: added extcon_alloc_muex to simplify extcon register function

    >The mutual exclusive part is functionalized from extcon_dev_register.
    >
    >Signed-off-by: Bumwoo Lee <bw365.lee@samsung.com>
    >---
    > drivers/extcon/extcon.c | 105 ++++++++++++++++++++++------------------
    > 1 file changed, 57 insertions(+), 48 deletions(-)
    >
    >diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
    >index 28058a1d2745..93cab4fe178e 100644
    >--- a/drivers/extcon/extcon.c
    >+++ b/drivers/extcon/extcon.c
    >@@ -1125,6 +1125,60 @@ static int extcon_alloc_cables(struct extcon_dev *edev)
    >         return 0;
    > }

    ...
    >-                if (!edev->attrs_muex) {
    >-                        ret = -ENOMEM;
    >-                        goto err_muex;
    >-                }
    ...
    >+        if (extcon_alloc_muex(edev))
    >+                goto err_alloc_muex;

    It's not good.
    You may return an uninitialized value or 0 when your new function has an error.

    Cheers,
    MyungJoo


    \
     
     \ /
      Last update: 2023-03-27 00:28    [W:3.084 / U:0.264 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site