Re: [PATCH ath-next] wifi: ath5k: ahb: use devm for ioremap

From: Rosen Penev

Date: Thu Feb 26 2026 - 18:58:30 EST


On Tue, Feb 24, 2026 at 10:23 AM Jiri Slaby <jirislaby@xxxxxxxxxx> wrote:
>
> On 23. 02. 26, 4:08, Rosen Penev wrote:
> > Simplifies the code by quite a bit in probe.
> >
> > Also allows removing a goto and returning directly.
>
> Looks good except:
>
> > --- a/drivers/net/wireless/ath/ath5k/ahb.c
> > +++ b/drivers/net/wireless/ath/ath5k/ahb.c
> ...
> > @@ -95,35 +94,21 @@ static int ath_ahb_probe(struct platform_device *pdev)
> >
> > if (!dev_get_platdata(&pdev->dev)) {
> > dev_err(&pdev->dev, "no platform data specified\n");
> > - ret = -EINVAL;
> > - goto err_out;
> > + return -EINVAL;
> > }
> >
> > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > - if (res == NULL) {
> > - dev_err(&pdev->dev, "no memory resource found\n");
> > - ret = -ENXIO;
> > - goto err_out;
> > - }
> > -
> > - mem = ioremap(res->start, resource_size(res));
> > - if (mem == NULL) {
> > - dev_err(&pdev->dev, "ioremap failed\n");
> > - ret = -ENOMEM;
> > - goto err_out;
> > - }
> > + mem = devm_platform_ioremap_resources(pdev, 0);
>
> Is this a typo or devm_platform_ioremap_resources() is new?
typo. Looks like COMPILE_TEST is needed.
>
> --
> js
> suse labs