lkml.org 
[lkml]   [2018]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 10/12] usb: typec: driver for Pericom PI3USB30532 Type-C cross switch
On Fri, Feb 16, 2018 at 12:47 PM, Hans de Goede <hdegoede@redhat.com> wrote:
> Add a driver for the Pericom PI3USB30532 Type-C cross switch /
> mux chip found on some devices with a Type-C port.


> +static int pi3usb30532_set_conf(struct pi3usb30532 *pi, u8 new_conf)
> +{
> + int ret = 0;
> +
> + if (pi->conf == new_conf)
> + return 0;
> +
> + ret = i2c_smbus_write_byte_data(pi->client, PI3USB30532_CONF, new_conf);

> + if (ret == 0)
> + pi->conf = new_conf;
> + else
> + dev_err(&pi->client->dev, "Error writing conf: %d\n", ret);

Usual pattern, please.

if (ret) {
...
return ret;
}

return 0;

> +
> + return ret;
> +}

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2018-02-16 14:35    [W:0.063 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site