Re: [PATCH v11 6/9] libata: handle power transition of ODD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux