Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759595AbcJSSbx (ORCPT ); Wed, 19 Oct 2016 14:31:53 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58952 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759067AbcJSSbd (ORCPT ); Wed, 19 Oct 2016 14:31:33 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sergei Shtylyov , Laurent Pinchart , Geert Uytterhoeven , Mauro Carvalho Chehab Subject: [PATCH 4.8 1/4] [media] v4l: rcar-fcp: Dont force users to check for disabled FCP support Date: Wed, 19 Oct 2016 20:31:26 +0200 Message-Id: <20161019182927.801409627@linuxfoundation.org> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161019182927.746970025@linuxfoundation.org> References: <20161019182927.746970025@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1690 Lines: 43 4.8-stable review patch. If anyone has any objections, please let me know. ------------------ From: Laurent Pinchart 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. Reported-by: Sergei Shtylyov Signed-off-by: Laurent Pinchart Reviewed-by: Geert Uytterhoeven Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- include/media/rcar-fcp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/media/rcar-fcp.h +++ b/include/media/rcar-fcp.h @@ -29,7 +29,7 @@ static inline struct rcar_fcp_device *rc 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