diff mbox series

[wireless-next,v2,3/3] wifi: wlcore: sdio: Use helper to define resources

Message ID 20240904154919.118513-4-vassilisamir@gmail.com (mailing list archive)
State Accepted
Commit a3ede2b0e65a955d64a00261efec56d9e1e1f872
Delegated to: Kalle Valo
Headers show
Series Use functionality of | expand

Commit Message

Vasileios Amoiridis Sept. 4, 2024, 3:49 p.m. UTC
Resources definition can become simpler and more organised by
using the dedicated helpers.

Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
---
 drivers/net/wireless/ti/wlcore/sdio.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

Comments

Khan, Sabeeh Sept. 9, 2024, 9:38 a.m. UTC | #1
Hi Vasileios,

On 9/4/2024 7:49 PM, Vasileios Amoiridis wrote:
> Resources definition can become simpler and more organised by
> using the dedicated helpers.
>
> Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
> ---
>  drivers/net/wireless/ti/wlcore/sdio.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
> index 9e1b644beba9..a73207bbe5d7 100644
> --- a/drivers/net/wireless/ti/wlcore/sdio.c
> +++ b/drivers/net/wireless/ti/wlcore/sdio.c
> @@ -323,15 +323,12 @@ static int wl1271_probe(struct sdio_func *func,
>  
>  	memset(res, 0x00, sizeof(res));
>  
> -	res[0].start = irq;
> -	res[0].flags = IORESOURCE_IRQ | irq_get_trigger_type(irq);
> -	res[0].name = "irq";
> -
> +	res[0] = DEFINE_RES_IRQ_NAMED(irq, "irq");
> +	res[0].flags |= irq_get_trigger_type(irq);
>  
>  	if (wakeirq > 0) {
> -		res[1].start = wakeirq;
> -		res[1].flags = IORESOURCE_IRQ | irq_get_trigger_type(wakeirq);
> -		res[1].name = "wakeirq";
> +		res[1] = DEFINE_RES_IRQ_NAMED(wakeirq, "wakeirq");
> +		res[1].flags |= irq_get_trigger_type(wakeirq);
>  		num_irqs = 2;
>  	} else {
>  		num_irqs = 1;

Tested-by: Sabeeh Khan <sabeeh-khan@ti.com>
Reviewed-by: Sabeeh Khan <sabeeh-khan@ti.com>
Vasileios Amoiridis Sept. 10, 2024, 9:58 p.m. UTC | #2
On Mon, Sep 09, 2024 at 01:38:58PM +0400, Khan, Sabeeh wrote:
> Hi Vasileios,
> 
> On 9/4/2024 7:49 PM, Vasileios Amoiridis wrote:
> > Resources definition can become simpler and more organised by
> > using the dedicated helpers.
> >
> > Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
> > ---
> >  drivers/net/wireless/ti/wlcore/sdio.c | 11 ++++-------
> >  1 file changed, 4 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
> > index 9e1b644beba9..a73207bbe5d7 100644
> > --- a/drivers/net/wireless/ti/wlcore/sdio.c
> > +++ b/drivers/net/wireless/ti/wlcore/sdio.c
> > @@ -323,15 +323,12 @@ static int wl1271_probe(struct sdio_func *func,
> >  
> >  	memset(res, 0x00, sizeof(res));
> >  
> > -	res[0].start = irq;
> > -	res[0].flags = IORESOURCE_IRQ | irq_get_trigger_type(irq);
> > -	res[0].name = "irq";
> > -
> > +	res[0] = DEFINE_RES_IRQ_NAMED(irq, "irq");
> > +	res[0].flags |= irq_get_trigger_type(irq);
> >  
> >  	if (wakeirq > 0) {
> > -		res[1].start = wakeirq;
> > -		res[1].flags = IORESOURCE_IRQ | irq_get_trigger_type(wakeirq);
> > -		res[1].name = "wakeirq";
> > +		res[1] = DEFINE_RES_IRQ_NAMED(wakeirq, "wakeirq");
> > +		res[1].flags |= irq_get_trigger_type(wakeirq);
> >  		num_irqs = 2;
> >  	} else {
> >  		num_irqs = 1;
> 
> Tested-by: Sabeeh Khan <sabeeh-khan@ti.com>
> Reviewed-by: Sabeeh Khan <sabeeh-khan@ti.com>
> 

Hi Sabeeh,

Thank you very much!

Cheers,
Vasilis
diff mbox series

Patch

diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index 9e1b644beba9..a73207bbe5d7 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -323,15 +323,12 @@  static int wl1271_probe(struct sdio_func *func,
 
 	memset(res, 0x00, sizeof(res));
 
-	res[0].start = irq;
-	res[0].flags = IORESOURCE_IRQ | irq_get_trigger_type(irq);
-	res[0].name = "irq";
-
+	res[0] = DEFINE_RES_IRQ_NAMED(irq, "irq");
+	res[0].flags |= irq_get_trigger_type(irq);
 
 	if (wakeirq > 0) {
-		res[1].start = wakeirq;
-		res[1].flags = IORESOURCE_IRQ | irq_get_trigger_type(wakeirq);
-		res[1].name = "wakeirq";
+		res[1] = DEFINE_RES_IRQ_NAMED(wakeirq, "wakeirq");
+		res[1].flags |= irq_get_trigger_type(wakeirq);
 		num_irqs = 2;
 	} else {
 		num_irqs = 1;