Re: [PATCH 4/7] PCI: Remove request_flags relict from devres

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2025-05-15 at 16:00 +0300, Andy Shevchenko wrote:
> On Thu, May 15, 2025 at 02:46:02PM +0200, Philipp Stanner wrote:
> > pcim_request_region_exclusive(), the only user in PCI devres that
> > needed
> > exclusive region requests, has been removed.
> > 
> > All features related to exclusive requests can, therefore, be
> > removed,
> > too. Remove them.
> 
> ...
> 
> >  int pcim_request_region(struct pci_dev *pdev, int bar, const char
> > *name)
> >  {
> > -	return _pcim_request_region(pdev, bar, name, 0);
> > +	int ret;
> > +	struct pcim_addr_devres *res;
> > +
> > +	if (!pci_bar_index_is_valid(bar))
> > +		return -EINVAL;
> > +
> > +	res = pcim_addr_devres_alloc(pdev);
> > +	if (!res)
> > +		return -ENOMEM;
> > +	res->type = PCIM_ADDR_DEVRES_TYPE_REGION;
> > +	res->bar = bar;
> > +
> > +	ret = __pcim_request_region(pdev, bar, name, 0);
> 
> > +	if (ret != 0) {
> 
> While at it, drop the  ' != 0' part?

I want it to be clear to be just a pure code move. It's a shame that
the git-diff can't just handle that through the function head,
resulting in a +/-2 diff

Style adjustments, which might also be necessary in pci.c in many
places, could be done through dedicated commits.

P.

> 
> > +		pcim_addr_devres_free(res);
> > +		return ret;
> > +	}
> > +
> > +	devres_add(&pdev->dev, res);
> > +	return 0;
> >  }
> 






[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux