Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp410409pxv; Thu, 15 Jul 2021 07:08:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkyVLafBl6pMwEh6M4sC07eW8g2+nGjk/d28quALw6aewcec0AdQkQtp79SVwprUwacqgf X-Received: by 2002:a92:6c11:: with SMTP id h17mr2767887ilc.96.1626358091626; Thu, 15 Jul 2021 07:08:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626358091; cv=none; d=google.com; s=arc-20160816; b=JPIK4w6f46KWEolCpNVGRq+j+Pe8NoUn01D2idB5yPi1F8/3oDoflb6TchAALZKYu3 lJyMpEmeKBNU5sHWkjbD/952uW80Fj50O3T8IvtfwdwR74VbbjvuL8jTFExsByO0uKXn l8TCvzuvCU+8EyPHgojJ/XgmGYBczT2xyVY9JLpIevzNjq3D6aZzvMF9RmWAqLQX/eoi Ak/1v0Wm5SzMKmFP+cyBChEYWwAWQUi8vc0R6wKXwWXIvJk9onHtqrvWgUc/TkGWZj6F 2xqDEGY6Ajtqg0rZw67IEA7zRBSVJ6+jR7Jp5Yhx9Dvc+DzyQ4qiJzJkNef8tgk3n3Hk CPKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=NNGGBvaih1yHdYuSGZbyf/Zy+9/9A7H2BIggPEnV+rs=; b=sW0RgrXKgvOml1uxpOkqZghOexSE455/RmTdsTKadUU7FRebfUsTGDZ5D7RuuYVVwz yOO4+HKkqRAbqjR0qkzVmP1kig7UejZOxBDKoz0km4VZMPQCAqipX1kiT1dOyGIu3mpl qGzrqpqXziIJp63l41sFAPfzwygy0WPl8U0BoeHO9s1kASXQGfNTfF5B/mP3D+BjhZGZ siYuQ4AWk2BmRwo50SQqA8kauvSdOM0XpciVShyVAvcDRF6rM3pew1l+xM5xZFNgCQbG hoRUlD3Y9NmnHmvWX8VdOxN+QWqhdm4e6wV/FMRmZWrYu8NkD+6Wkkub9a1Do7mkQxvY fo3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i36si7254596jav.110.2021.07.15.07.07.54; Thu, 15 Jul 2021 07:08:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234479AbhGOMQP (ORCPT + 99 others); Thu, 15 Jul 2021 08:16:15 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:47854 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S234430AbhGOMQO (ORCPT ); Thu, 15 Jul 2021 08:16:14 -0400 X-UUID: ffe1033cc78943fa92af2fc1e36de5be-20210715 X-UUID: ffe1033cc78943fa92af2fc1e36de5be-20210715 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 321558719; Thu, 15 Jul 2021 20:13:18 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 15 Jul 2021 20:13:16 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 15 Jul 2021 20:13:16 +0800 From: Yong Wu To: Krzysztof Kozlowski , Rob Herring , Matthias Brugger CC: Krzysztof Kozlowski , Joerg Roedel , Will Deacon , Robin Murphy , Tomasz Figa , , , , , , , , , , , , Subject: [PATCH v2 06/11] memory: mtk-smi: Add error handle for smi_probe Date: Thu, 15 Jul 2021 20:12:04 +0800 Message-ID: <20210715121209.31024-7-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210715121209.31024-1-yong.wu@mediatek.com> References: <20210715121209.31024-1-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add error handle while component_add fail. Signed-off-by: Yong Wu --- It don't have the error handle when v1. it is not a fatal error. thus don't add fix tags. --- drivers/memory/mtk-smi.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index 6f8e582bace5..e68cbb51dd12 100644 --- a/drivers/memory/mtk-smi.c +++ b/drivers/memory/mtk-smi.c @@ -330,7 +330,15 @@ static int mtk_smi_larb_probe(struct platform_device *pdev) pm_runtime_enable(dev); platform_set_drvdata(pdev, larb); - return component_add(dev, &mtk_smi_larb_component_ops); + ret = component_add(dev, &mtk_smi_larb_component_ops); + if (ret) + goto err_pm_disable; + return 0; + +err_pm_disable: + pm_runtime_disable(dev); + device_link_remove(dev, larb->smi_common_dev); + return ret; } static int mtk_smi_larb_remove(struct platform_device *pdev) -- 2.18.0