Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755399AbcDNM57 (ORCPT ); Thu, 14 Apr 2016 08:57:59 -0400 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:23438 "EHLO mx0a-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753900AbcDNM5x (ORCPT ); Thu, 14 Apr 2016 08:57:53 -0400 From: Jisheng Zhang To: , , , CC: , , , Jisheng Zhang Subject: [PATCH 3/4] i2c: designware-pcidrv: enable RuntimePM before registering to the core Date: Thu, 14 Apr 2016 20:53:33 +0800 Message-ID: <1460638414-5987-4-git-send-email-jszhang@marvell.com> X-Mailer: git-send-email 2.8.0.rc3 In-Reply-To: <1460638414-5987-1-git-send-email-jszhang@marvell.com> References: <1460638414-5987-1-git-send-email-jszhang@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-04-14_07:,, signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603180000 definitions=main-1604140186 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1263 Lines: 38 As pointed out by commit 36d48fb5766a ("i2c: designware-platdrv: enable RuntimePM before registering to the core"), "The core may register clients attached to this master which may use funtionality from the master", so enable RuntimePM before registering to the core. Signed-off-by: Jisheng Zhang --- drivers/i2c/busses/i2c-designware-pcidrv.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c index 7368be0..41a01a7 100644 --- a/drivers/i2c/busses/i2c-designware-pcidrv.c +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c @@ -248,14 +248,17 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(&pdev->dev)); adap->nr = controller->bus_num; + pm_runtime_set_autosuspend_delay(&pdev->dev, 1000); + pm_runtime_use_autosuspend(&pdev->dev); + pm_runtime_allow(&pdev->dev); + r = i2c_dw_probe(dev); - if (r) + if (r) { + pm_runtime_forbid(&pdev->dev); return r; + } - pm_runtime_set_autosuspend_delay(&pdev->dev, 1000); - pm_runtime_use_autosuspend(&pdev->dev); pm_runtime_put_autosuspend(&pdev->dev); - pm_runtime_allow(&pdev->dev); return 0; } -- 2.8.0.rc3