Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750825AbdCNJ2v (ORCPT ); Tue, 14 Mar 2017 05:28:51 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:32895 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750742AbdCNJ2u (ORCPT ); Tue, 14 Mar 2017 05:28:50 -0400 Date: Tue, 14 Mar 2017 10:28:46 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Arvind Yadav Cc: mjg59@srcf.ucam.org, dvhart@infradead.org, andy@infradead.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] platform/x86: dell-laptop: Handle return error form dell_get_intensity. Message-ID: <20170314092846.GB7422@pali> References: <1489038596-3765-1-git-send-email-arvind.yadav.cs@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1489038596-3765-1-git-send-email-arvind.yadav.cs@gmail.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1138 Lines: 38 On Thursday 09 March 2017 11:19:56 Arvind Yadav wrote: > Here, This patch is to handle a return error from dell_get_intensity. > This change is done using Coccinelle. > > Signed-off-by: Arvind Yadav Ok, seems good. You can add my Acked-By. > --- > 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: -- Pali Rohár pali.rohar@gmail.com