Re: [PATCHv2] spi: ppc4xx: devm-ify probe and drop manual resource management
Mark Brown <[email protected]> Mon, 20 Jul 2026 13:38:42 +0100
| Newsgroups | org.kernel.vger.linux-spi,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
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.
signature.asc
(application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmpeFtEACgkQJNaLcl1U h9DpbAf/SvHjC8cPmLOHNIra/KE48U+uGdIlbovzgB1EotGlk6MCIFK+TuVVjvI0 flBLCNewl5Pwjz0SS0xz2p58HYaQ8CmHsq24+rhWxtMNnf1uMzhttivPlrNbGr5Q lhH3X3IJjN/H8xf+GSx1+a5enjlgfOzsjBdpUKW/uQyGHDbEmRtmBP2KtPuFP7zF myTwl3oAGDv8w/XcUFHP71RzjurlR/BBeejk1cvzVG+TIsDXSLgBZXoN+Ic4EjHM 6vkedln6i9z7B4RtFi7+aZ3z5EoqGm6hvvklUcpBCqknhreOJuGE1LHDUWjHNmgr XVJBgrf/nHDaWaso4IUz/mezCF2VrQ== =tN28 -----END PGP SIGNATURE-----