From patchwork Fri Mar 22 11:30:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2319031 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 3925A3FD8C for ; Fri, 22 Mar 2013 11:30:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754639Ab3CVLaW (ORCPT ); Fri, 22 Mar 2013 07:30:22 -0400 Received: from mail-bk0-f44.google.com ([209.85.214.44]:55013 "EHLO mail-bk0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754628Ab3CVLaW (ORCPT ); Fri, 22 Mar 2013 07:30:22 -0400 Received: by mail-bk0-f44.google.com with SMTP id j4so1849991bkw.31 for ; Fri, 22 Mar 2013 04:30:20 -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=/rMGYjK4OCayJ1D/DEWwkvzhtA1aWZBKgkxWUs9Q+X8=; b=CPdC7BAzktrKk3ndPZxGnqG14n3h+6mQz5DUSX5yEG0kq77Y/i2vqFEmVJcNCS31Lh FaQoB/3VUrPXY4/4ognHi5KSxE2VHc6yHZ11csRVwLSP8BKIQs1PjQiLaLgx2yQm7b3L Nno+UW/8hbLhOD5htQExFOWeDGt7f3rIGM80cTdCui5IAMSNQaiNkfe4Paq1D1+9HKtR pvXAHUfknpS4ol/QBmGsP4fvGyA5xHtpY2KdhlEO8z0u2N+kIzVZ3g/Y9uzpFVkr0QVU wfp9LIF2d8t+HVjo5h+YpPg5m4rqD8geVvF5qgWXg0JxsWfSZA7FP7rigmSYZBA/1urO dnng== MIME-Version: 1.0 X-Received: by 10.205.32.208 with SMTP id sl16mr748774bkb.27.1363951820800; Fri, 22 Mar 2013 04:30:20 -0700 (PDT) Received: by 10.204.30.210 with HTTP; Fri, 22 Mar 2013 04:30:20 -0700 (PDT) Date: Fri, 22 Mar 2013 19:30:20 +0800 Message-ID: Subject: [PATCH -next] backlight: adp8860: fix error return code in adp8860_led_probe() From: Wei Yongjun To: michael.hennerich@analog.com, rpurdie@rpsys.net, FlorianSchandinat@gmx.de Cc: yongjun_wei@trendmicro.com.cn, device-drivers-devel@blackfin.uclinux.org, 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 Acked-by: Michael Hennerich --- drivers/video/backlight/adp8860_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/adp8860_bl.c b/drivers/video/backlight/adp8860_bl.c index 6bb7f36..75b10f8 100644 --- a/drivers/video/backlight/adp8860_bl.c +++ b/drivers/video/backlight/adp8860_bl.c @@ -249,12 +249,14 @@ static int adp8860_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; }