Re: [PATCH] ata: pata_platform: Use devm_ioremap_resource()

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

 



>Понедельник, 17 декабря 2018, 18:28 +03:00 от Sergei Shtylyov <sergei.shtylyov@xxxxxxxxxxxxxxxxxx>:
...
>>  if (mmio) {
>> -ap->ioaddr.cmd_addr = devm_ioremap(dev, io_res->start,
>> -resource_size(io_res));
>> -ap->ioaddr.ctl_addr = devm_ioremap(dev, ctl_res->start,
>> -resource_size(ctl_res));
>> +ap->ioaddr.cmd_addr = devm_ioremap_resource(dev, io_res);
>> +if (IS_ERR(ap->ioaddr.cmd_addr))
>> +return PTR_ERR(ap->ioaddr.cmd_addr);
>> +ap->ioaddr.ctl_addr = devm_ioremap_resource(dev, ctl_res);
>> +if (IS_ERR(ap->ioaddr.ctl_addr))
>> +return PTR_ERR(ap->ioaddr.ctl_addr);
>>  } else {
>>  ap->ioaddr.cmd_addr = devm_ioport_map(dev, io_res->start,
>>  resource_size(io_res));
>>  ap->ioaddr.ctl_addr = devm_ioport_map(dev, ctl_res->start,
>>  resource_size(ctl_res));
>> -}
>> -if (!ap->ioaddr.cmd_addr || !ap->ioaddr.ctl_addr) {
>> -dev_err(dev, "failed to map IO/CTL base\n");
>> -return -ENOMEM;
>> +if (!ap->ioaddr.cmd_addr || !ap->ioaddr.ctl_addr) {
>> +dev_err(dev, "failed to map IO/CTL base\n");
>> +return -ENOMEM;
>> +}
>
>   Note the "imbalance" you're introducing: for MMIO request_mem_region() is
>called now (by devm_ioremap_resource(), while for I/O porst request_region()
>is not.

Well, in this case, we can just throw it away.
I just took apart the changes that have accumulated over the past 2.5 years.

Thanks.
---




[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux