From patchwork Thu Mar 14 15:09:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 2271721 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 233113FCF6 for ; Thu, 14 Mar 2013 15:09:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756814Ab3CNPJi (ORCPT ); Thu, 14 Mar 2013 11:09:38 -0400 Received: from bhuna.collabora.co.uk ([93.93.135.160]:46305 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751089Ab3CNPJh (ORCPT ); Thu, 14 Mar 2013 11:09:37 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: javier) with ESMTPSA id DC5C21698514 From: Javier Martinez Canillas To: Jon Hunter Cc: Benoit Cousson , Tony Lindgren , Grant Likely , Russell King , Enric Balletbo i Serra , Ezequiel Garcia , Matthias Brugger , linux-omap@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, Javier Martinez Canillas Subject: [PATCH 1/3] ARM: OMAP2+: return -ENODEV if GPMC child device creation fails Date: Thu, 14 Mar 2013 16:09:20 +0100 Message-Id: <1363273762-17441-2-git-send-email-javier.martinez@collabora.co.uk> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1363273762-17441-1-git-send-email-javier.martinez@collabora.co.uk> References: <1363273762-17441-1-git-send-email-javier.martinez@collabora.co.uk> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org gpmc_probe_nor_child() calls of_platform_device_create() to create a platform device for the NOR child. If this function fails the value of ret is returned to the caller but this value is zero since it was assigned the return of a previous call to gpmc_cs_program_settings() that had to succeed or otherwise gpmc_probe_nor_child() would have returned before. This means that if of_platform_device_create() fails, 0 will be returned to the caller instead of an appropriate error code. Signed-off-by: Javier Martinez Canillas --- arch/arm/mach-omap2/gpmc.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index d594e1d..8799aed 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c @@ -1505,6 +1505,7 @@ static int gpmc_probe_nor_child(struct platform_device *pdev, return 0; dev_err(&pdev->dev, "failed to create gpmc child %s\n", child->name); + ret = -ENODEV; err: gpmc_cs_free(cs);