Skip to content

Commit 6cc8cbb

Browse files
Kuppuswamy Sathyanarayananandy-shev
authored andcommitted
platform/x86: intel_punit_ipc: Fix resource ioremap warning
For PUNIT device, ISPDRIVER_IPC and GTDDRIVER_IPC resources are not mandatory. So when PMC IPC driver creates a PUNIT device, if these resources are not available then it creates dummy resource entries for these missing resources. But during PUNIT device probe, doing ioremap on these dummy resources generates following warning messages. intel_punit_ipc: can't request region for resource [mem 0x00000000] intel_punit_ipc: can't request region for resource [mem 0x00000000] intel_punit_ipc: can't request region for resource [mem 0x00000000] intel_punit_ipc: can't request region for resource [mem 0x00000000] This patch fixes this issue by adding extra check for resource size before performing ioremap operation. Signed-off-by: Kuppuswamy Sathyanarayanan <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent ce7ff1c commit 6cc8cbb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/platform/x86/intel_punit_ipc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,28 +252,28 @@ static int intel_punit_get_bars(struct platform_device *pdev)
252252
* - GTDRIVER_IPC BASE_IFACE
253253
*/
254254
res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
255-
if (res) {
255+
if (res && resource_size(res) > 1) {
256256
addr = devm_ioremap_resource(&pdev->dev, res);
257257
if (!IS_ERR(addr))
258258
punit_ipcdev->base[ISPDRIVER_IPC][BASE_DATA] = addr;
259259
}
260260

261261
res = platform_get_resource(pdev, IORESOURCE_MEM, 3);
262-
if (res) {
262+
if (res && resource_size(res) > 1) {
263263
addr = devm_ioremap_resource(&pdev->dev, res);
264264
if (!IS_ERR(addr))
265265
punit_ipcdev->base[ISPDRIVER_IPC][BASE_IFACE] = addr;
266266
}
267267

268268
res = platform_get_resource(pdev, IORESOURCE_MEM, 4);
269-
if (res) {
269+
if (res && resource_size(res) > 1) {
270270
addr = devm_ioremap_resource(&pdev->dev, res);
271271
if (!IS_ERR(addr))
272272
punit_ipcdev->base[GTDRIVER_IPC][BASE_DATA] = addr;
273273
}
274274

275275
res = platform_get_resource(pdev, IORESOURCE_MEM, 5);
276-
if (res) {
276+
if (res && resource_size(res) > 1) {
277277
addr = devm_ioremap_resource(&pdev->dev, res);
278278
if (!IS_ERR(addr))
279279
punit_ipcdev->base[GTDRIVER_IPC][BASE_IFACE] = addr;

0 commit comments

Comments
 (0)