[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151020130256.GE20289@localhost>
Date: Tue, 20 Oct 2015 15:02:56 +0200
From: Johan Hovold <johan@...nel.org>
To: Konstantin Shkolnyy <konstantin.shkolnyy@...il.com>
Cc: Johan Hovold <johan@...nel.org>, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] USB: serial: cp210x: Implement 16-bit register
access functions
On Tue, Oct 20, 2015 at 07:52:31AM -0500, Konstantin Shkolnyy wrote:
> On Tue, Oct 20, 2015 at 2:45 AM, Johan Hovold <johan@...nel.org> wrote:
> [...]
> > Instead of adding the new helpers to read u16 as a prerequisite for
> > fixing the broken cp2108 support, just reuse the current config register
> > helpers for now (in order to keep the fixes minimal and potentially
> > backportable). Once the fixes are in place, feel free to clean up the
> > remaining register accesses.
>
> The current helpers take "port" as a parameter. You pointed out
> previously that port shouldn't be used in probe(). That made me
> implement new helpers cp210x_write_u16_reg and cp210x_read_u16_reg
> that don't use port. Probe() now calls cp210x_activate_workarounds
> which in turn calls these new helpers.
Oh, that's right.
> An alternative would be to call usb_control_msg from
> cp210x_activate_workarounds, but I think it would make it look pretty
> ugly.
Or you move the quirk-detect (and private data allocation) to port_probe
instead (and remove startup/release). These devices have exactly one
port per interface, so you wouldn't introduce any redundancy.
Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists