Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965376AbbBCBsZ (ORCPT ); Mon, 2 Feb 2015 20:48:25 -0500 Received: from mail-bn1bn0101.outbound.protection.outlook.com ([157.56.110.101]:47117 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932612AbbBCBsW (ORCPT ); Mon, 2 Feb 2015 20:48:22 -0500 X-Greylist: delayed 1071 seconds by postgrey-1.27 at vger.kernel.org; Mon, 02 Feb 2015 20:48:21 EST X-WSS-ID: 0NJ68UO-07-2KT-02 X-M-MSG: Message-ID: <1422925495.2528.12.camel@kxue-X58A-UD3R> Subject: Re: [PATCH V2] acpi:apd:add AMD ACPI2Platform device support for x86 system. From: Ken Xue To: "mika.westerberg@linux.intel.com" CC: "Rafael J. Wysocki" , "andy.shevchenko@gmail.com" , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" Date: Tue, 3 Feb 2015 09:04:55 +0800 In-Reply-To: <20150202130356.GS22740@lahna.fi.intel.com> References: <1422870652.2528.6.camel@kxue-X58A-UD3R> <20150202130356.GS22740@lahna.fi.intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.221;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(377424004)(51704005)(24454002)(33646002)(110136001)(87936001)(2351001)(33716001)(92566002)(23676002)(2501002)(2950100001)(106466001)(77096005)(77156002)(62966003)(47776003)(103116003)(50226001)(86362001)(46102003)(19580405001)(19580395003)(50466002)(76176999)(50986999)(3940600001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR0201MB1005;H:atltwp01.amd.com;FPR:;SPF:None;MLV:sfv;LANG:en; Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:DM2PR0201MB1005; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004);SRVR:DM2PR0201MB1005; X-Forefront-PRVS: 0476D4AB88 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:DM2PR0201MB1005; X-OriginatorOrg: amd4.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Feb 2015 01:16:03.5565 (UTC) X-MS-Exchange-CrossTenant-Id: fde4dada-be84-483f-92cc-e026cbee8e96 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fde4dada-be84-483f-92cc-e026cbee8e96;Ip=[165.204.84.221] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0201MB1005 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1618 Lines: 46 On Mon, 2015-02-02 at 15:03 +0200, mika.westerberg@linux.intel.com wrote: > On Mon, Feb 02, 2015 at 05:50:52PM +0800, Ken Xue wrote: > > >From b9654ecbfaebde00aee746a024eec9fe8de24b97 Mon Sep 17 00:00:00 2001 > > From: Ken Xue > > Date: Mon, 2 Feb 2015 17:32:24 +0800 > > Subject: [PATCH] This new feature is to interpret AMD specific ACPI device to > > platform device such as I2C, UART found on AMD CZ and later chipsets. It > > based on example INTEL LPSS. Now, it can support AMD I2C & UART. > > Looks good to me. There are few smallish issues still, see below. > ... > > + switch (action) { > > + case BUS_NOTIFY_ADD_DEVICE: > > + if (pdata->dev_desc->flags & ACPI_APD_PM) { > > + if (pdata->dev_desc->flags & ACPI_APD_PM_ON) > > + ret = dev_pm_domain_attach(&pdev->dev, true); > > + else > > + ret = dev_pm_domain_attach(&pdev->dev, false); > > How about: > > power_on = !!(pdata->dev_desc->flags & ACPI_APD_PM_ON) > ret = dev_pm_domain_attach(&pdev->dev, power_on); > > ? good > > Furthermore I think this is not needed at all. If you check > platform_drv_probe() it calls dev_pm_domain_attach() already. > as you said, platform_drv_probe calls dev_pm_domain_attach(). but platform_drv_probe just is a default probe routine. Not all platform device drivers use this probe routine. so, codes here may be still necessary. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/