Re: [PATCH] fpga: altera-hps2fpga: do not request reset by index
From: Philipp Zabel
Date: Mon Nov 09 2026 - 02:56:04 EST
On Sa, 2026-11-07 at 20:00 +0800, Xu Yilun wrote:
> On Fri, Nov 06, 2026 at 04:43:19PM +0100, Philipp Zabel wrote:
> > There is no need to request a single reset by index.
> > Use of_reset_control_get_exclusive() to request the first and only
> > reset.
> >
> > Signed-off-by: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>
> > ---
> > drivers/fpga/altera-hps2fpga.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/fpga/altera-hps2fpga.c b/drivers/fpga/altera-hps2fpga.c
> > index f2f1250689cb..9b7f5b8191b8 100644
> > --- a/drivers/fpga/altera-hps2fpga.c
> > +++ b/drivers/fpga/altera-hps2fpga.c
> > @@ -134,8 +134,7 @@ static int alt_fpga_bridge_probe(struct platform_device *pdev)
> >
> > priv = (struct altera_hps2fpga_data *)device_get_match_data(dev);
> >
> > - priv->bridge_reset = of_reset_control_get_exclusive_by_index(dev->of_node,
> > - 0);
> > + priv->bridge_reset = of_reset_control_get_exclusive(dev->of_node, NULL);
>
> Saved a 0 arg but add a NULL arg, Any benifit to justify the code churn?
I'd like to remove the _by_index() API once there are no users left.
For a while now, these functions are only ever called with index == 0.
regards
Philipp