lkml.org 
[lkml]   [2020]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 01/24] Input: bcm-keypad - Simplify with dev_err_probe()
    Date
    Common pattern of handling deferred probe can be simplified with
    dev_err_probe(). Less code and also it prints the error value.

    Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
    ---
    drivers/input/keyboard/bcm-keypad.c | 8 +++-----
    1 file changed, 3 insertions(+), 5 deletions(-)

    diff --git a/drivers/input/keyboard/bcm-keypad.c b/drivers/input/keyboard/bcm-keypad.c
    index 2b771c3a5578..1bf71e7c9e0d 100644
    --- a/drivers/input/keyboard/bcm-keypad.c
    +++ b/drivers/input/keyboard/bcm-keypad.c
    @@ -379,11 +379,9 @@ static int bcm_kp_probe(struct platform_device *pdev)
    kp->clk = devm_clk_get(&pdev->dev, "peri_clk");
    if (IS_ERR(kp->clk)) {
    error = PTR_ERR(kp->clk);
    - if (error != -ENOENT) {
    - if (error != -EPROBE_DEFER)
    - dev_err(&pdev->dev, "Failed to get clock\n");
    - return error;
    - }
    + if (error != -ENOENT)
    + return dev_err_probe(&pdev->dev, error, "Failed to get clock\n");
    +
    dev_dbg(&pdev->dev,
    "No clock specified. Assuming it's enabled\n");
    kp->clk = NULL;
    --
    2.17.1
    \
     
     \ /
      Last update: 2020-08-26 20:17    [W:4.399 / U:0.112 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site