From patchwork Mon May 13 08:52:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2557081 Return-Path: X-Original-To: patchwork-linux-media@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 785A9DF2E5 for ; Mon, 13 May 2013 08:52:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751717Ab3EMIwS (ORCPT ); Mon, 13 May 2013 04:52:18 -0400 Received: from mail-bk0-f41.google.com ([209.85.214.41]:40757 "EHLO mail-bk0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751638Ab3EMIwR (ORCPT ); Mon, 13 May 2013 04:52:17 -0400 Received: by mail-bk0-f41.google.com with SMTP id jc3so2303624bkc.28 for ; Mon, 13 May 2013 01:52:16 -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=AnP+cKL98kWTgplDajEtLNUQCBhcdSWWcunI8zulCc4=; b=fYQvuTc9IW08bXNBvkIUfuhudsdjQEFl6XRAucKdtzfD/jhUxg+sTNjuGC1VPZvYQv HJZ7bSadvtvWbusRqUto1LXWsfPg47S4LmuWq6e9lhQl9unFxPZt2rd1Upio8A0EptyZ mrDFu/s2kFO6i2mYXIrwdEmSibCdw/PxoTOnV3NuVBV1vCT1M95sSbvBQJza/1mGRbE6 t+7kH12Xn96uwjsSK9iuy9/OZ8bCH7KjvDlFANH239LRYx+z0S5F1gn9dphUFtjxijxK hXmjWKnJoZh0C2hRaxtrT0lizbv7sX8Qtti6tmKpzB4gcZukPYuK+kLaXvIte3GWCgI7 KhpQ== MIME-Version: 1.0 X-Received: by 10.204.168.201 with SMTP id v9mr5151757bky.116.1368435136165; Mon, 13 May 2013 01:52:16 -0700 (PDT) Received: by 10.204.199.129 with HTTP; Mon, 13 May 2013 01:52:16 -0700 (PDT) Date: Mon, 13 May 2013 16:52:16 +0800 Message-ID: Subject: [PATCH v2] [media] blackfin: fix error return code in bcap_probe() From: Wei Yongjun To: scott.jiang.linux@gmail.com, mchehab@redhat.com Cc: yongjun_wei@trendmicro.com.cn, uclinux-dist-devel@blackfin.uclinux.org, linux-media@vger.kernel.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Wei Yongjun Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun Acked-by: Scott Jiang --- v1 -> v2: move config->num_inputs check to the beginning of this function --- drivers/media/platform/blackfin/bfin_capture.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" 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/media/platform/blackfin/bfin_capture.c b/drivers/media/platform/blackfin/bfin_capture.c index 0e55b08..391d9a9 100644 --- a/drivers/media/platform/blackfin/bfin_capture.c +++ b/drivers/media/platform/blackfin/bfin_capture.c @@ -960,7 +960,7 @@ static int bcap_probe(struct platform_device *pdev) int ret; config = pdev->dev.platform_data; - if (!config) { + if (!config || !config->num_inputs) { v4l2_err(pdev->dev.driver, "Unable to get board config\n"); return -ENODEV; } @@ -1067,11 +1067,6 @@ static int bcap_probe(struct platform_device *pdev) NULL); if (bcap_dev->sd) { int i; - if (!config->num_inputs) { - v4l2_err(&bcap_dev->v4l2_dev, - "Unable to work without input\n"); - goto err_unreg_vdev; - } /* update tvnorms from the sub devices */ for (i = 0; i < config->num_inputs; i++) @@ -1079,6 +1074,7 @@ static int bcap_probe(struct platform_device *pdev) } else { v4l2_err(&bcap_dev->v4l2_dev, "Unable to register sub device\n"); + ret = -ENODEV; goto err_unreg_vdev; }