linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luciano Coelho <luciano.coelho-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
To: ext Ohad Ben-Cohen <ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>
Cc: "linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"John W. Linville"
	<linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>,
	Mark Brown
	<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	Chikkature Rajashekar Madhusudhan
	<madhu.cr-l0cyMroinI0@public.gmane.org>,
	San Mehat <san-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	"Quadros Roger (Nokia-MS/Helsinki)"
	<roger.quadros-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>,
	Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>,
	Nicolas Pitre <nico-vtqb6HGKxmzR7s880joybQ@public.gmane.org>,
	Ido Yariv <ido-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>,
	Kalle Valo <kalle.valo-X3B1VOXEql0@public.gmane.org>,
	Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
	Vitaly Wool <vitalywool-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH v6 2/7] wl1271: propagate set_power's return value
Date: Thu, 16 Sep 2010 22:40:18 +0300	[thread overview]
Message-ID: <1284666018.8951.66.camel@powerslave> (raw)
In-Reply-To: <1284592929-29616-3-git-send-email-ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>

On Thu, 2010-09-16 at 01:22 +0200, ext Ohad Ben-Cohen wrote:
> Make it possible for the set power method to indicate a
> success/failure return value. This is needed to support
> more complex power on/off operations such as SDIO
> power manipulations.
> 
> Signed-off-by: Ohad Ben-Cohen <ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>
> ---

Some comments below.


> diff --git a/drivers/net/wireless/wl12xx/wl1271_io.h b/drivers/net/wireless/wl12xx/wl1271_io.h
> index bc806c7..c1f92e6 100644
> --- a/drivers/net/wireless/wl12xx/wl1271_io.h
> +++ b/drivers/net/wireless/wl12xx/wl1271_io.h
> @@ -144,10 +144,13 @@ static inline void wl1271_power_off(struct wl1271 *wl)
>  	clear_bit(WL1271_FLAG_GPIO_POWER, &wl->flags);
>  }
>  
> -static inline void wl1271_power_on(struct wl1271 *wl)
> +static inline int wl1271_power_on(struct wl1271 *wl)
>  {
> -	wl->if_ops->power(wl, true);
> -	set_bit(WL1271_FLAG_GPIO_POWER, &wl->flags);
> +	int ret = wl->if_ops->power(wl, true);

I think it look nicer if you keep the "int ret" in one line by itself
and then do a ret = wl->if_ops... on another one.


> +	if (ret == 0)
> +		set_bit(WL1271_FLAG_GPIO_POWER, &wl->flags);
> +
> +	return ret;
>  }


> diff --git a/drivers/net/wireless/wl12xx/wl1271_sdio.c b/drivers/net/wireless/wl12xx/wl1271_sdio.c
> index b5d9565..1d5dc72 100644
> --- a/drivers/net/wireless/wl12xx/wl1271_sdio.c
> +++ b/drivers/net/wireless/wl12xx/wl1271_sdio.c
> @@ -159,35 +159,38 @@ static void wl1271_sdio_raw_write(struct wl1271 *wl, int addr, void *buf,
>  		wl1271_error("sdio write failed (%d)", ret);
>  }
>  
> -static void wl1271_sdio_power_on(struct wl1271 *wl)
> +static int wl1271_sdio_power_on(struct wl1271 *wl)
>  {
>  	struct sdio_func *func = wl_to_func(wl);
>  
>  	sdio_claim_host(func);
>  	sdio_enable_func(func);
>  	sdio_release_host(func);
> +
> +	return 0;
>  }

You seem to always return 0, so the whole chain to pass the value up
seems unnecessary.  Is this just a preparation for a future patch?

-- 
Cheers,
Luca.

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2010-09-16 19:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-15 23:22 [PATCH v6 0/7] native wl1271 support on ZOOM Ohad Ben-Cohen
2010-09-15 23:22 ` [PATCH v6 1/7] wl12xx: make wl12xx.h common to both spi and sdio Ohad Ben-Cohen
2010-09-16 10:17   ` Teemu Paasikivi
2010-09-16 10:45     ` Ohad Ben-Cohen
     [not found]       ` <AANLkTikYd+TojQC-R+Vrdou6KSRwFNczBeTnsX7eTDn4-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-16 11:16         ` [PATCH v6 01/17] " Ohad Ben-Cohen
2010-09-16 11:50           ` [PATCH v6 1/7] " Ohad Ben-Cohen
     [not found]           ` <1284635762-12335-1-git-send-email-ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>
2010-09-16 18:35             ` [PATCH v6 01/17] " Luciano Coelho
2010-09-16 19:56               ` Ohad Ben-Cohen
2010-09-16 20:00                 ` Luciano Coelho
2010-09-16 20:46               ` Tony Lindgren
     [not found] ` <1284592929-29616-1-git-send-email-ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>
2010-09-15 23:22   ` [PATCH v6 2/7] wl1271: propagate set_power's return value Ohad Ben-Cohen
     [not found]     ` <1284592929-29616-3-git-send-email-ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>
2010-09-16 19:40       ` Luciano Coelho [this message]
2010-09-16 19:53         ` Ohad Ben-Cohen
2010-09-16 19:56           ` Luciano Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1284666018.8951.66.camel@powerslave \
    --to=luciano.coelho-xnzwkgviw5gavxtiumwx3w@public.gmane.org \
    --cc=broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
    --cc=ido-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org \
    --cc=kalle.valo-X3B1VOXEql0@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org \
    --cc=madhu.cr-l0cyMroinI0@public.gmane.org \
    --cc=nico-vtqb6HGKxmzR7s880joybQ@public.gmane.org \
    --cc=ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org \
    --cc=roger.quadros-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org \
    --cc=san-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org \
    --cc=vitalywool-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).