From patchwork Fri Mar 22 11:30:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2319041 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id BD990DFE82 for ; Fri, 22 Mar 2013 11:30:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932792Ab3CVLao (ORCPT ); Fri, 22 Mar 2013 07:30:44 -0400 Received: from mail-bk0-f52.google.com ([209.85.214.52]:55582 "EHLO mail-bk0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932790Ab3CVLan (ORCPT ); Fri, 22 Mar 2013 07:30:43 -0400 Received: by mail-bk0-f52.google.com with SMTP id jk13so1815888bkc.11 for ; Fri, 22 Mar 2013 04:30:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to:cc :content-type; bh=xKs1k+MQQiNK+xlh7JMUZkZ/X9rnHBj64PqOWWby5VM=; b=OhHPw7fgdTGmkNtqLx5ShMYD0/xAHSIVw4d81JOZs6HxZLVQ0LJChx947HIgwpSKqn T7igL5e/uHGbuO23elXVBv6MqsCWdvdbf9m5rlw6fpcXcom5C5j1i2rcvDWIUbkIOORq aHsC9r27ig7hh9m9mRBgKeYhBt9GHGmMzkMbaIx5VR8rAEJL3Orwn+Id9pZyt05GJwVw 4ET7Dh/IlQfFnUo0WVQtkzKDC+CFHuhR9m9JNKy2N/6cQgVs146+jQn9Q74pCH9MuBke GtUXfUcFySx6jQGOhPR7roJnmwVI3z/eK/HulKy5wopSa/fgiGz9GPNYweFnQgpkj2nZ 1mXw== MIME-Version: 1.0 X-Received: by 10.204.238.133 with SMTP id ks5mr723983bkb.101.1363951842378; Fri, 22 Mar 2013 04:30:42 -0700 (PDT) Received: by 10.204.30.210 with HTTP; Fri, 22 Mar 2013 04:30:42 -0700 (PDT) Date: Fri, 22 Mar 2013 19:30:42 +0800 Message-ID: Subject: [PATCH -next] backlight: adp8870: fix error return code in adp8870_led_probe() From: Wei Yongjun To: rpurdie@rpsys.net, FlorianSchandinat@gmx.de Cc: yongjun_wei@trendmicro.com.cn, linux-fbdev@vger.kernel.org Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org From: Wei Yongjun Fix to return a negative error code from the error handling case instead of 0, as returned elsewhere in this function. Signed-off-by: Wei Yongjun Acked-by: Jingoo Han --- drivers/video/backlight/adp8870_bl.c | 2 ++ 1 file changed, 2 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/video/backlight/adp8870_bl.c b/drivers/video/backlight/adp8870_bl.c index 302c800..759bf23 100644 --- a/drivers/video/backlight/adp8870_bl.c +++ b/drivers/video/backlight/adp8870_bl.c @@ -274,12 +274,14 @@ static int adp8870_led_probe(struct i2c_client *client) if (led_dat->id > 7 || led_dat->id < 1) { dev_err(&client->dev, "Invalid LED ID %d\n", led_dat->id); + ret = -EINVAL; goto err; } if (pdata->bl_led_assign & (1 << (led_dat->id - 1))) { dev_err(&client->dev, "LED %d used by Backlight\n", led_dat->id); + ret = -EBUSY; goto err; }