From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Lu Subject: Re: [PATCH v11 6/9] libata: handle power transition of ODD Date: Tue, 08 Jan 2013 17:09:48 +0800 Message-ID: <50EBE25C.30504@intel.com> References: <1357440509-28108-1-git-send-email-aaron.lu@intel.com> <1357440509-28108-7-git-send-email-aaron.lu@intel.com> <20130107184245.GS3926@htj.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from mga09.intel.com ([134.134.136.24]:26405 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752899Ab3AHJJK (ORCPT ); Tue, 8 Jan 2013 04:09:10 -0500 In-Reply-To: <20130107184245.GS3926@htj.dyndns.org> Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: Tejun Heo Cc: Jeff Garzik , James Bottomley , "Rafael J. Wysocki" , Alan Stern , Aaron Lu , Jeff Wu , linux-ide@vger.kernel.org, linux-pm@vger.kernel.org, linux-scsi@vger.kernel.org, linux-acpi@vger.kernel.org On 01/08/2013 02:42 AM, Tejun Heo wrote: > On Sun, Jan 06, 2013 at 10:48:26AM +0800, Aaron Lu wrote: >> +bool zpodd_zpready(struct ata_device *dev) >> +{ >> + struct zpodd *zpodd = dev->zpodd; >> + return zpodd->zp_ready; >> +} >> + >> +void zpodd_pre_poweroff(struct ata_device *dev) >> +{ >> + struct zpodd *zpodd = dev->zpodd; >> + >> + zpodd->powered_off = true; >> + device_set_run_wake(&dev->sdev->sdev_gendev, true); >> + acpi_pm_device_run_wake(&dev->sdev->sdev_gendev, true); >> +} >> + >> +void zpodd_pre_poweron(struct ata_device *dev) >> +{ >> + struct zpodd *zpodd = dev->zpodd; >> + >> + if (zpodd->powered_off) { >> + acpi_pm_device_run_wake(&dev->sdev->sdev_gendev, false); >> + device_set_run_wake(&dev->sdev->sdev_gendev, false); >> + } >> +} >> + >> +void zpodd_post_resume(struct ata_device *dev) >> +{ >> + struct zpodd *zpodd = dev->zpodd; >> + >> + if (!zpodd->powered_off) >> + return; >> + >> + zpodd->powered_off = false; >> + >> + if (zpodd->from_notify) { >> + zpodd->from_notify = false; >> + if (zpodd->drawer) >> + eject_tray(dev); >> + } >> + >> + zpodd->last_ready = 0; >> + zpodd->zp_ready = false; >> +} > > I would really appreciate some comments at least on functions visible > outside zpodd.c. Please add proper function comments explaining what > they're doing to achieve what. Will add them in next version, thanks. -Aaron