It is not recommened to use platform_get_resource(pdev, IORESOURCE_IRQ) for requesting IRQ's resources any more, as they can be not ready yet in case of DT-booting. platform_get_irq() instead is a recommended way for getting IRQ even if it was not retrieved earlier. It also makes code simpler because we're getting "int" value right away and no conversion from resource to int is required.
Unified · Split
| @@ -327,10 +327,11 @@ static int bcm63xx_drv_pcmcia_probe(struct platform_device *pdev) · 326 unmodified lines | ||
| 327 | 327 | { |
| 328 | 328 | struct bcm63xx_pcmcia_socket *skt; |
| 329 | 329 | struct pcmcia_socket *sock; |
| 330 | − struct resource *res, *irq_res; | |
| 330 | + struct resource *res; | |
| 331 | 331 | unsigned int regmem_size = 0, iomem_size = 0; |
| 332 | 332 | u32 val; |
| 333 | 333 | int ret; |
| 334 | + int irq; | |
| 334 | 335 | |
| 335 | 336 | skt = kzalloc(sizeof(*skt), GFP_KERNEL); |
| 336 | 337 | if (!skt) |
| @@ -342,9 +343,9 @@ static int bcm63xx_drv_pcmcia_probe(struct platform_device *pdev) · 5 unmodified lines | ||
| 342 | 343 | /* make sure we have all resources we need */ |
| 343 | 344 | skt->common_res = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
| 344 | 345 | skt->attr_res = platform_get_resource(pdev, IORESOURCE_MEM, 2); |
| 345 | − irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | |
| 346 | + irq = platform_get_irq(pdev, 0); | |
| 346 | 347 | skt->pd = pdev->dev.platform_data; |
| 347 | − if (!skt->common_res || !skt->attr_res || !irq_res || !skt->pd) { | |
| 348 | + if (!skt->common_res || !skt->attr_res || (irq < 0) || !skt->pd) { | |
| 348 | 349 | ret = -EINVAL; |
| 349 | 350 | goto err; |
| 350 | 351 | } |
| @@ -380,7 +381,7 @@ static int bcm63xx_drv_pcmcia_probe(struct platform_device *pdev) · 29 unmodified lines | ||
| 380 | 381 | sock->dev.parent = &pdev->dev; |
| 381 | 382 | sock->features = SS_CAP_STATIC_MAP | SS_CAP_PCCARD; |
| 382 | 383 | sock->io_offset = (unsigned long)skt->io_base; |
| 383 | − sock->pci_irq = irq_res->start; | |
| 384 | + sock->pci_irq = irq; | |
| 384 | 385 | |
| 385 | 386 | #ifdef CONFIG_CARDBUS |
| 386 | 387 | sock->cb_dev = bcm63xx_cb_dev; |