From: Gerhard Sittig Date: Sun, 10 Nov 2013 19:17:31 +0100 Subject: [U-Boot] [PATCH v6 07/17] dm: Add README for driver model In-Reply-To: <1383841933-1800-8-git-send-email-sjg@chromium.org> References: <1383841933-1800-1-git-send-email-sjg@chromium.org> <1383841933-1800-8-git-send-email-sjg@chromium.org> Message-ID: <20131110181731.GI17929@book.gsilab.sittig.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Nov 07, 2013 at 09:32 -0700, Simon Glass wrote: > > +Declaring Drivers > +----------------- > + > +A driver declaration looks something like this (see > +drivers/demo/demo-shape.c): > + > +static const struct demo_ops simple_ops = { > + .hello = shape_hello, > + .status = shape_status, > +}; > + > +U_BOOT_DRIVER(demo_shape_drv) = { > + .name = "demo_shape_drv", > + .id = UCLASS_DEMO, > + .ops = &simple_ops, > + .priv_data_size = sizeof(struct shape_data), > +}; Should the variable 'simple_ops' be named 'shape_ops' or 'demo_shape_ops', to better reflect that it's the list of operations for the 'shape' driver which implements the 'demo' class API? Because 'simple' is found nowhere else in this example. > +Things to punt for later > +------------------------ > + > [ ... ] > + > +For pre-relocation we can simply call the driver model init function. Then > +post relocation we throw that away and re-init driver model again. For drivers > +which require some sort of continuity between pre- and post-relocation > +devices, we can provide access to the pre-relocatoin device pointers. s/relocatoin/relocation/ virtually yours Gerhard Sittig -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de