From patchwork Tue Sep 4 16:14:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Senna Tschudin X-Patchwork-Id: 1403201 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 8F8DEDF280 for ; Tue, 4 Sep 2012 16:15:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757280Ab2IDQOy (ORCPT ); Tue, 4 Sep 2012 12:14:54 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:51844 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757335Ab2IDQOx (ORCPT ); Tue, 4 Sep 2012 12:14:53 -0400 Received: by mail-wg0-f44.google.com with SMTP id dr13so5825722wgb.1 for ; Tue, 04 Sep 2012 09:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=/87dc4pfgA6y5GG7w4q6p72w/MpocT5QSE5MnuOuSVY=; b=rjT8Zszobuij7LTPaV3P/FicQhMF4Km3G1aHfpAMEXnRNkVX1K45trbPRGHBkwTVBi ZWOVU6vURUQqdbY6fpqhkx6TJjV+FUVEa+EY7Qx/M/UWIiMfEUyYR0RU5Xfc0M4n8xSZ vZ33klZpT/5D6dHVWWyp3zbnEEegYoPvFiYHN3l0GIArRNvu+FPu7s0ufGzJ+h+waIuJ dsNeJcDYOhE/hkcwLZZzt6oNWZmXtbIxrnxeRnVX3gb52IKm2JfxCRefTeGE3q4ENO4P K+OIgvuYpcRNtu14RG2V9M9YT9v4BorAULqQS85MbK7ctxCUnA6baD8JwTTRfrJXE6ei YC1g== Received: by 10.180.108.45 with SMTP id hh13mr31706648wib.15.1346775291967; Tue, 04 Sep 2012 09:14:51 -0700 (PDT) Received: from localhost.localdomain ([132.227.100.38]) by mx.google.com with ESMTPS id l6sm24969613wiz.4.2012.09.04.09.14.51 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Sep 2012 09:14:51 -0700 (PDT) From: Peter Senna Tschudin To: Mauro Carvalho Chehab Cc: kernel-janitors@vger.kernel.org, Julia.Lawall@lip6.fr, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/5] drivers/media/platform/s5p-tv/sdo_drv.c: fix error return code Date: Tue, 4 Sep 2012 18:14:28 +0200 Message-Id: <1346775269-12191-4-git-send-email-peter.senna@gmail.com> X-Mailer: git-send-email 1.7.11.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Peter Senna Tschudin Convert a nonnegative error return code to a negative one, as returned elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // Signed-off-by: Peter Senna Tschudin --- drivers/media/platform/s5p-tv/sdo_drv.c | 3 +++ 1 file changed, 3 insertions(+) -- 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/s5p-tv/sdo_drv.c b/drivers/media/platform/s5p-tv/sdo_drv.c index ad68bbe..58cf56d 100644 --- a/drivers/media/platform/s5p-tv/sdo_drv.c +++ b/drivers/media/platform/s5p-tv/sdo_drv.c @@ -369,6 +369,7 @@ static int __devinit sdo_probe(struct platform_device *pdev) sdev->fout_vpll = clk_get(dev, "fout_vpll"); if (IS_ERR_OR_NULL(sdev->fout_vpll)) { dev_err(dev, "failed to get clock 'fout_vpll'\n"); + ret = -ENODEV; goto fail_dacphy; } dev_info(dev, "fout_vpll.rate = %lu\n", clk_get_rate(sclk_vpll)); @@ -377,11 +378,13 @@ static int __devinit sdo_probe(struct platform_device *pdev) sdev->vdac = devm_regulator_get(dev, "vdd33a_dac"); if (IS_ERR_OR_NULL(sdev->vdac)) { dev_err(dev, "failed to get regulator 'vdac'\n"); + ret = -ENODEV; goto fail_fout_vpll; } sdev->vdet = devm_regulator_get(dev, "vdet"); if (IS_ERR_OR_NULL(sdev->vdet)) { dev_err(dev, "failed to get regulator 'vdet'\n"); + ret = -ENODEV; goto fail_fout_vpll; }