public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: micky_ching@realsil.com.cn
Cc: sameo@linux.intel.com, lee.jones@linaro.org,
	gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	wei_wang@realsil.com.cn, rogerable@realtek.com,
	devel@linuxdriverproject.org
Subject: Re: [PATCH 1/2] mfd: rtsx: fix PM suspend for 5227
Date: Thu, 11 Sep 2014 10:42:49 +0300	[thread overview]
Message-ID: <20140911074249.GW6600@mwanda> (raw)
In-Reply-To: <c13c93e9f5fca1a46df2b141899d50c13b28aaa0.1410330111.git.micky_ching@realsil.com.cn>

On Thu, Sep 11, 2014 at 03:17:52PM +0800, micky_ching@realsil.com.cn wrote:
> +	/* reset PM_CTRL3 before send buffer cmd */
> +	err = rtsx_pci_write_register(pcr, PM_CTRL3, 0x10, 0x00);
> +	if (err < 0)
> +		return err;
> +
> +	return err;

Just do:
	return rtsx_pci_write_register(pcr, PM_CTRL3, 0x10, 0x00);

> +}
> +
>  static int rts5227_optimize_phy(struct rtsx_pcr *pcr)
>  {
> +	int err;
> +
> +	err = rts5227_pm_reset(pcr);
> +	if (err < 0)
> +		return err;
> +
>  	/* Optimize RX sensitivity */
>  	return rtsx_pci_write_phy_register(pcr, 0x00, 0xBA42);
>  }
> diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h
> index 74346d5..037fbc5 100644
> --- a/include/linux/mfd/rtsx_pci.h
> +++ b/include/linux/mfd/rtsx_pci.h
> @@ -967,4 +967,17 @@ static inline u8 *rtsx_pci_get_cmd_data(struct rtsx_pcr *pcr)
>  	return (u8 *)(pcr->host_cmds_ptr);
>  }
> 
> +static inline int rtsx_pci_update_cfg_byte(struct rtsx_pcr *pcr, int addr,
> +		u8 mask, u8 append)
> +{
> +	int err;
> +	u8 val;
> +
> +	err = pci_read_config_byte(pcr->pci, addr, &val);
> +	if (err)
> +		return err;

Some of these check for "if (err) " and some check for "if (err < 0) ".
What is the significance of that?  I'm a newbie here.  Did you mean for
them to be different?


> +	err = pci_write_config_byte(pcr->pci, addr, (val & mask) | append);
> +	return err;

	return pci_write_config_byte(pcr->pci, addr, (val & mask) | append);

regards,
dan carpenter


  reply	other threads:[~2014-09-11  7:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-11  7:17 [PATCH 0/2] mfd: rtsx: fix PM suspend for 5227 & 5249 micky_ching
2014-09-11  7:17 ` [PATCH 1/2] mfd: rtsx: fix PM suspend for 5227 micky_ching
2014-09-11  7:42   ` Dan Carpenter [this message]
2014-09-12  8:36     ` Dan Carpenter
2014-09-12  8:43       ` micky
2014-09-11  7:17 ` [PATCH 2/2] mfd: rtsx: fix PM suspend for 5249 micky_ching

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=20140911074249.GW6600@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=micky_ching@realsil.com.cn \
    --cc=rogerable@realtek.com \
    --cc=sameo@linux.intel.com \
    --cc=wei_wang@realsil.com.cn \
    /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