Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1384579
| From | Andy Shevchenko <andy.shevchenko@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] platform:x86 decouple telemetry driver from the optional IPC resources |
| Date | 2016-04-21 23:20 +0200 |
| Message-ID | <rqub0-7sG-23@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <rmnrt-5Be-25@gated-at.bofh.it> <rmnUv-5P1-9@gated-at.bofh.it> <rnZXI-2t3-3@gated-at.bofh.it> <ro1wt-3Ok-3@gated-at.bofh.it> <ro4b0-65U-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Apr 15, 2016 at 8:05 AM, Darren Hart <dvhart@infradead.org> wrote:
>> >>>> + /*
>> >>>> + * The following resources are optional
>> >>>> + * - ISPDRIVER_IPC BASE_DATA
>> >>>> + * - ISPDRIVER_IPC BASE_IFACE
>> >>>> + * - GTDRIVER_IPC BASE_DATA
>> >>>> + * - GTDRIVER_IPC BASE_IFACE
>> >>>> + */
>> >>>> res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
>> >>>> - addr = devm_ioremap_resource(&pdev->dev, res);
>> >>>> - if (IS_ERR(addr))
>> >>>> - return PTR_ERR(addr);
>> >>>> - punit_ipcdev->base[ISPDRIVER_IPC][BASE_DATA] = addr;
>> >>>> + if (res) {
>> >>>> + addr = devm_ioremap_resource(&pdev->dev, res);
>> >>>> + if (!IS_ERR(addr))
>> >>>> + punit_ipcdev->base[ISPDRIVER_IPC][BASE_DATA] = addr;
>> >>>> + }
>> >>>
>> >>> And here, what about just replacing return to dev_warn()?
>> >>
>> >> I don't think we need to continue the subsequent ops if an error address
>> >> returns.
>> >
>> > Why is that? Will the driver fail to provide any functionality? Or could it be
>> > the other IFACEs could still be of some use?
>> >
>> > This one does need a justification.
>> >
>> We discussed this.
>> - For the necessary resources, if we obtain an error address, we should
>> return immediately.
>> - For the optional resources, we keep quiet if we don't get them, that
>> is, not throwing a warning out.
>
> Andy, he's checking for "res" now too, which is a good extra check since
> devm_ioremap_resource will issue a dev_err "invalid resource" if it's NULL, even
> though in our case, that's expected for an optional resource. This adds the
> extra nesting, and a dev_warn wouldn't be appropriate for an option resource.
>
> I'm happy to queue this to fixes at this point. Andy, are you OK with the
> resolution here?
Gmail hided this mail from me by some reason. I'm fine with the resolution.
--
With Best Regards,
Andy Shevchenko
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH] platform:x86 decouple telemetry driver from the optional IPC resources Andy Shevchenko <andy.shevchenko@gmail.com> - 2016-04-21 23:20 +0200
csiph-web