From patchwork Thu Mar 9 05:49:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9612285 X-Patchwork-Delegate: andy.shevchenko@gmail.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1B0AE60417 for ; Thu, 9 Mar 2017 05:58:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B0E1285EF for ; Thu, 9 Mar 2017 05:58:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2AD5285F5; Thu, 9 Mar 2017 05:58:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B14BA285EF for ; Thu, 9 Mar 2017 05:58:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750789AbdCIF6l (ORCPT ); Thu, 9 Mar 2017 00:58:41 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:36815 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750763AbdCIF6j (ORCPT ); Thu, 9 Mar 2017 00:58:39 -0500 Received: by mail-pf0-f193.google.com with SMTP id j5so6137999pfb.3; Wed, 08 Mar 2017 21:58:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=XXTKL3SPxe6ic8AajjpPbOdOCnDg914Ebbf3AxhAKfM=; b=GKaUR4OH5h4hF+Q3lo47m3tfKGVYBWFIrvjkZoy/wbhlDZaHhugcBnVP3nyzJ9t3sT h6fUUYF44zps5qbN25EW7/hYBqmzg23z2GhzlI0c6L7AxfYmFeHlmcu5FUBN73yXCdpd /G9jYYdQ06LG8T5jPIqavj5XcyHEM8cbFcZsDt4P+LFSaFgdEoSFX6lil3gw78OWrjkw y2gwa9zoBHpufcARVTDGrQERPC0yZKtPPrXpmX2lyGieKOROvC7GeGUWutYP1+Su3kCv bye734gwe0OMKYP/wyGqN1gVMFnDvNhzmSKxi5RLfBFAJx0sVs2RPfC/+Dsk/j3ajTcx hx9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=XXTKL3SPxe6ic8AajjpPbOdOCnDg914Ebbf3AxhAKfM=; b=JFeCfjsfJpMS/dK8z/cu1I1v3mfBja4f0SCdxZlci0IgW+jlVEeY3X1lwWBGPTtSg+ Od6V9FDmpw4FyqEuatEVcnGo1bvQFBWUHd4R2t1t70ovAZnFKhGok/A2mP4m2UDBzGTd gaCtJIjdmhsI+deCdXS30vjrn3aL9caRtRWmIxq1cZfdcCI4IruY04jAqWr0Sp9IMZtJ L1YNwVBbKIFIUxu0twFcTBiFsBgbOeWgG37G6pI7F3fza0XShWLnhl968BdRIVa1wttX qyFIQAId81FqR1jSnejuoFIsaQff7myIfbrqW/z4NazaBdJgZ2sxYYXIjD+dfhVtF4kT SEcg== X-Gm-Message-State: AMke39m5a07bev810NJgCZALaVUxZJMOOY80D+qNKQyEZDUhSbrF1vks1XJeRhm0v97EsA== X-Received: by 10.99.143.91 with SMTP id r27mr11699273pgn.151.1489038616014; Wed, 08 Mar 2017 21:50:16 -0800 (PST) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id d3sm9479122pfc.51.2017.03.08.21.50.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Mar 2017 21:50:15 -0800 (PST) From: Arvind Yadav To: mjg59@srcf.ucam.org, pali.rohar@gmail.com, dvhart@infradead.org, andy@infradead.org Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] platform/x86: dell-laptop: Handle return error form dell_get_intensity. Date: Thu, 9 Mar 2017 11:19:56 +0530 Message-Id: <1489038596-3765-1-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Here, This patch is to handle a return error from dell_get_intensity. This change is done using Coccinelle. Signed-off-by: Arvind Yadav --- drivers/platform/x86/dell-laptop.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c index f57dd28..7fcf680 100644 --- a/drivers/platform/x86/dell-laptop.c +++ b/drivers/platform/x86/dell-laptop.c @@ -2053,11 +2053,17 @@ static int __init dell_init(void) dell_backlight_device->props.brightness = dell_get_intensity(dell_backlight_device); + if (dell_backlight_device->props.brightness < 0) { + ret = dell_backlight_device->props.brightness; + goto fail_get_brightness; + } backlight_update_status(dell_backlight_device); } return 0; +fail_get_brightness: + backlight_device_unregister(dell_backlight_device); fail_backlight: dell_cleanup_rfkill(); fail_rfkill: