Re: [PATCH] regmap: Add function check before called format_val

2015-08-14 Thread Mark Brown
On Thu, Aug 13, 2015 at 11:25:05PM +0800, Henry Chen wrote: > On Wed, 2015-08-12 at 22:20 +0800, Daniel Kurtz wrote: > > Making mtk_pmic-wrap into a regmap_bus makes a bit of sense > > architecturally, too, since it is essentially just a bus for accessing > > the registers of an off-chip PMIC. Th

Re: [PATCH] regmap: Add function check before called format_val

2015-08-13 Thread Henry Chen
On Wed, 2015-08-12 at 22:20 +0800, Daniel Kurtz wrote: > > Since I didn't see it elsewhere in this discussion, I'll point out > that the "regression" here was introduced by commit [0], which added > the call to map->format.format_val from regmap_bulk_read() when > map->bus == NULL. > > [0] commi

Re: [PATCH] regmap: Add function check before called format_val

2015-08-12 Thread Daniel Kurtz
Hi Henry & Mark, On Tue, Jul 21, 2015 at 2:07 PM, Henry Chen wrote: > On Mon, 2015-07-20 at 16:02 +0100, Mark Brown wrote: >> On Mon, Jul 20, 2015 at 08:41:50PM +0800, Henry Chen wrote: >> > The regmap_format will not be initialize since regmap_bus is not assgined >> > on regmap_init(). It should

Re: [PATCH] regmap: Add function check before called format_val

2015-07-22 Thread Mark Brown
On Wed, Jul 22, 2015 at 10:31:34PM +0800, Henry Chen wrote: > On Tue, 2015-07-21 at 18:25 +0100, Mark Brown wrote: > > OK, so the issue here is that when we fall back to regmap_read() we may > > do so because we have reg_read() and reg_write() functions which in turn > > imply no formatting. The

Re: [PATCH] regmap: Add function check before called format_val

2015-07-22 Thread Henry Chen
On Tue, 2015-07-21 at 18:25 +0100, Mark Brown wrote: > On Tue, Jul 21, 2015 at 02:07:25PM +0800, Henry Chen wrote: > > > Then in driver rtc-mt6397.c, it used regmap_bulk_read() to get the time > > of PMIC, and hit the null function of format_val(), because the > > regmap_bus was null. > > > It sk

Re: [PATCH] regmap: Add function check before called format_val

2015-07-21 Thread Mark Brown
On Tue, Jul 21, 2015 at 02:07:25PM +0800, Henry Chen wrote: > Then in driver rtc-mt6397.c, it used regmap_bulk_read() to get the time > of PMIC, and hit the null function of format_val(), because the > regmap_bus was null. > It skipped the initialization of format_val() because bus == null, but >

Re: [PATCH] regmap: Add function check before called format_val

2015-07-20 Thread Henry Chen
On Mon, 2015-07-20 at 16:02 +0100, Mark Brown wrote: > On Mon, Jul 20, 2015 at 08:41:50PM +0800, Henry Chen wrote: > > The regmap_format will not be initialize since regmap_bus is not assgined > > on regmap_init(). It should has a function check before using > > format_val() to avoid null functio

Re: [PATCH] regmap: Add function check before called format_val

2015-07-20 Thread Mark Brown
On Mon, Jul 20, 2015 at 08:41:50PM +0800, Henry Chen wrote: > The regmap_format will not be initialize since regmap_bus is not assgined > on regmap_init(). It should has a function check before using > format_val() to avoid null function called on regmap_bulk_read(). > - map-

[PATCH] regmap: Add function check before called format_val

2015-07-20 Thread Henry Chen
The regmap_format will not be initialize since regmap_bus is not assgined on regmap_init(). It should has a function check before using format_val() to avoid null function called on regmap_bulk_read(). Signed-off-by: Henry Chen --- Based on v4.2rc1 --- drivers/base/regmap/regmap.c | 5 - 1