From patchwork Tue Mar 10 01:18:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 5973261 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D1DD79F39D for ; Tue, 10 Mar 2015 01:18:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0BC7020416 for ; Tue, 10 Mar 2015 01:18:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF2B220414 for ; Tue, 10 Mar 2015 01:18:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751467AbbCJBSr (ORCPT ); Mon, 9 Mar 2015 21:18:47 -0400 Received: from nblzone-211-213.nblnetworks.fi ([83.145.211.213]:51045 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751230AbbCJBSr (ORCPT ); Mon, 9 Mar 2015 21:18:47 -0400 Received: from lanttu.localdomain (lanttu.localdomain [192.168.5.64]) by hillosipuli.retiisi.org.uk (Postfix) with ESMTP id BADEA60096; Tue, 10 Mar 2015 03:18:43 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: prabhakar.csengg@gmail.com, laurent.pinchart@ideasonboard.com Subject: [PATCH 1/3] smiapp: Clean up smiapp_get_pdata() Date: Tue, 10 Mar 2015 03:18:00 +0200 Message-Id: <1425950282-30548-2-git-send-email-sakari.ailus@iki.fi> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1425950282-30548-1-git-send-email-sakari.ailus@iki.fi> References: <1425950282-30548-1-git-send-email-sakari.ailus@iki.fi> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Don't set rval when it's not used (the function returns a pointer to struct smiapp_platform_data). Signed-off-by: Sakari Ailus Acked-by: Laurent Pinchart Tested-by: Lad, Prabhakar Acked-by: Lad, Prabhakar --- drivers/media/i2c/smiapp/smiapp-core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index b1f566b..565a00c 100644 --- a/drivers/media/i2c/smiapp/smiapp-core.c +++ b/drivers/media/i2c/smiapp/smiapp-core.c @@ -2988,10 +2988,8 @@ static struct smiapp_platform_data *smiapp_get_pdata(struct device *dev) return NULL; pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); - if (!pdata) { - rval = -ENOMEM; + if (!pdata) goto out_err; - } v4l2_of_parse_endpoint(ep, &bus_cfg); @@ -3001,7 +2999,6 @@ static struct smiapp_platform_data *smiapp_get_pdata(struct device *dev) break; /* FIXME: add CCP2 support. */ default: - rval = -EINVAL; goto out_err; }