Re: [PATCHv2] spi: ppc4xx: devm-ify probe and drop manual resource management

From: Mark Brown

Date: Mon Jul 20 2026 - 09:04:18 EST


On Sun, Jul 19, 2026 at 05:30:43PM -0700, Rosen Penev wrote:
> Replace open-coded resource handling with devm helpers:

> - ret = of_address_to_resource(np, 0, &resource);
> - if (ret) {
> - dev_err(dev, "error while parsing device node resource\n");
> - goto free_host;
> - }
> - hw->mapbase = resource.start;
> - hw->mapsize = resource_size(&resource);
> -
> - /* Sanity check */
> - if (hw->mapsize < sizeof(struct spi_ppc4xx_regs)) {
> - dev_err(dev, "too small to map registers\n");
> - ret = -EINVAL;
> - goto free_host;
> - }
> -

The size validation gets lost here. Not sure that really matters, but
it wasn't mentioned in the changelog.

> + ret = devm_request_irq(&op->dev, hw->irqnum, spi_ppc4xx_int,
> + 0, "spi_ppc4xx_of", hw);
> + if (ret)
> + return dev_err_probe(dev, ret, "unable to allocate interrupt\n");

devm_request_irq() has it's own logging so we don't need to duplicate.

Attachment: signature.asc
Description: PGP signature