On Tue, Oct 16, 2012 at 10:08:01AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote: > > > > > > here 4 resources > > > > We already had this. This SoC has a very strange register layout. The > > registers for the UARTs are spread around the SoC and the registers > > are not even exclusively used for the UARTs. They have bits which are > > also used for the timer and other stuff. > use the device id to select the register is wrong > > we need to pass the register via resource (without request) or platform data > > > > > > +static int clps711x_tstc(struct console_device *cdev) > > > > +{ > > > > + return !(readl(SYSFLG(cdev->dev->id)) & SYSFLG_URXFE); > > > factorise those pull status as > > > > > > status int xxx(data, mask) {} > > > > I don'r understand this. This is a single register read, there's not > > much to factorize and the code is easy to read. > he use the code at a least 2 place Testing for a bit like above is done a thousand times all around the kernel and barebox. There is nothing to factorize. The way Alexander did it is perfectly fine. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox