From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756131AbcARRrO (ORCPT ); Mon, 18 Jan 2016 12:47:14 -0500 Received: from mail-lb0-f193.google.com ([209.85.217.193]:34499 "EHLO mail-lb0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755981AbcARRrM (ORCPT ); Mon, 18 Jan 2016 12:47:12 -0500 Date: Mon, 18 Jan 2016 18:47:08 +0100 From: Johan Hovold To: Martyn Welch Cc: Konstantin Shkolnyy , johan@kernel.org, "linux-usb@vger.kernel.org" , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/4] USB: serial: cp210x: New register access functions. Message-ID: <20160118174708.GH3169@localhost> References: <1451704309-11906-1-git-send-email-konstantin.shkolnyy@gmail.com> <5697DCCB.30504@collabora.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5697DCCB.30504@collabora.co.uk> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 14, 2016 at 05:37:15PM +0000, Martyn Welch wrote: > On 02/01/16 03:11, Konstantin Shkolnyy wrote: > > cp210x_get_config and cp210x_set_config are cumbersome to use. This change > > introduces new register access functions to replace them. New functions > > are not yet called - the switch is done gradually in following changes. > > > > Signed-off-by: Konstantin Shkolnyy > > --- > > +/* > > + * Reads any 8-bit CP210X_ register identified by req. > > + */ > > +static int cp210x_read_u8_reg(struct usb_serial_port *port, u8 req, u8 *val) > > +{ > > + return cp210x_read_reg_block(port, req, val, sizeof(*val)); > > +} > > + > > +/* > > + * Writes any 16-bit CP210X_ register (req) whose value is passed > > + * entirely in the wValue field of the USB request. > > + */ > > +static int cp210x_write_u16_reg(struct usb_serial_port *port, u8 req, u16 val) > > Think this needs a different name to draw more attention to the fact > that it writes in a different way from cp210x_write_u32_reg and how the > cp210x_read_uXX_reg read. Not necessarily. Why would the caller need to care about that? Keeping the suggested names should be fine. Thanks, Johan