Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1573203

Re: [PATCH 4/6] bus: add driver for the Technologic Systems NBUS

From Sebastien Bourdelin <sebastien.bourdelin@savoirfairelinux.com>
Newsgroups linux.kernel
Subject Re: [PATCH 4/6] bus: add driver for the Technologic Systems NBUS
Date 2017-02-03 17:00 +0100
Message-ID <t6Orf-3Ei-9@gated-at.bofh.it> (permalink)
References <sOr06-6CZ-13@gated-at.bofh.it> <sOr06-6CZ-45@gated-at.bofh.it> <sU0gx-1tm-3@gated-at.bofh.it> <t69eq-1O3-21@gated-at.bofh.it> <t6Mz8-2gr-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Linus,

On 02/03/2017 08:51 AM, Linus Walleij wrote:
> Your child nodes I guess will be instatiated as devices as well.
> 
> These devices will have the NBUS driver as .parent in their
> struct device I guess. Else the design of this bus is tilted.
> 
> If the NBUS driver use dev_set_drvdata(dev, state_container_cookie)
> the children can use dev_get_drvdata(dev->parent); to get a pointer to
> the same cookie.
> 
> The subdrivers don't even need to know the members of the state
> container as long as you're just passing a pointer to it. It's
> enough if you forward-declare it as a "pointer to some struct":
> 
> struct foo;
> 
> {
>    struct foo *fooptr = dev_get_drvdata(dev->parent);
>    write(fooptr, 0x10);
> 
> etc

Thanks a lot, this is perfect!

Best Regards,
Sebastien.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH 4/6] bus: add driver for the Technologic Systems NBUS Sebastien Bourdelin <sebastien.bourdelin@savoirfairelinux.com> - 2017-02-01 21:00 +0100
  Re: [PATCH 4/6] bus: add driver for the Technologic Systems NBUS Linus Walleij <linus.walleij@linaro.org> - 2017-02-03 15:00 +0100
    Re: [PATCH 4/6] bus: add driver for the Technologic Systems NBUS Sebastien Bourdelin <sebastien.bourdelin@savoirfairelinux.com> - 2017-02-03 17:00 +0100

csiph-web