From patchwork Tue Oct 18 13:24:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 9382123 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9E55D607D0 for ; Tue, 18 Oct 2016 13:24:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DC8729567 for ; Tue, 18 Oct 2016 13:24:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82975295F6; Tue, 18 Oct 2016 13:24:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0006F29567 for ; Tue, 18 Oct 2016 13:24:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754454AbcJRNYe (ORCPT ); Tue, 18 Oct 2016 09:24:34 -0400 Received: from galahad.ideasonboard.com ([185.26.127.97]:58966 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760750AbcJRNY3 (ORCPT ); Tue, 18 Oct 2016 09:24:29 -0400 Received: from avalon.bb.dnainternet.fi (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804]) by galahad.ideasonboard.com (Postfix) with ESMTPSA id 591C32006D; Tue, 18 Oct 2016 15:23:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1476797017; bh=wJD/WY7XF4L3Eel0Y4XLcuneUnACc3my8OXDTzb4DOs=; h=From:To:Cc:Subject:Date:From; b=aEAi9w3V2MGOY/CHhziK31tk6dlxTKpTNQ/cG8va7fTEtuKam+a1sLL8q0sT6p5XQ xgF/OJnFX02faFJUn3N3Fhez3tn1DmSOcsEyPlgIqkVSRsedf3crmD7nbNNVBf6Uv2 YMIWFJNlkZVH0LFMtb525V5uk7l2z8txMCIez64U= From: Laurent Pinchart To: stable@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH] [media] v4l: rcar-fcp: Don't force users to check for disabled FCP support Date: Tue, 18 Oct 2016 16:24:20 +0300 Message-Id: <1476797060-8535-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 2.7.3 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP commit fd44aa9a254b18176ec3792a18e7de6977030ca8 upstream. The rcar_fcp_enable() function immediately returns successfully when the FCP device pointer is NULL to avoid forcing the users to check the FCP device manually before every call. However, the stub version of the function used when the FCP driver is disabled returns -ENOSYS unconditionally, resulting in a different API contract for the two versions of the function. As a user that requires FCP support will fail at probe time when calling rcar_fcp_get() if the FCP driver is disabled, the stub version of the rcar_fcp_enable() function will only be called with a NULL FCP device. We can thus return 0 unconditionally to align the behaviour with the normal version of the function. Fixes: 94fcdf829793 ("[media] v4l: vsp1: Add FCP support") Reported-by: Sergei Shtylyov Signed-off-by: Laurent Pinchart Reviewed-by: Geert Uytterhoeven Signed-off-by: Mauro Carvalho Chehab --- include/media/rcar-fcp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/media/rcar-fcp.h b/include/media/rcar-fcp.h index 4c7fc77eaf29..8723f05c6321 100644 --- a/include/media/rcar-fcp.h +++ b/include/media/rcar-fcp.h @@ -29,7 +29,7 @@ static inline struct rcar_fcp_device *rcar_fcp_get(const struct device_node *np) static inline void rcar_fcp_put(struct rcar_fcp_device *fcp) { } static inline int rcar_fcp_enable(struct rcar_fcp_device *fcp) { - return -ENOSYS; + return 0; } static inline void rcar_fcp_disable(struct rcar_fcp_device *fcp) { } #endif