From: Axel Lin Date: Sun, 7 Apr 2013 15:12:28 +0000 (+0800) Subject: regulator: ab8500: Get rid of is_enabled from struct ab8500_regulator_info X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~131^2~25^2~15 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=438e695b87e03953fc4ba1aff59feab33c9c79a7;p=pandora-kernel.git regulator: ab8500: Get rid of is_enabled from struct ab8500_regulator_info The intention of this patch is to simplify the code. Maintain the is_enabled flag is not trivial, it not only needs to set/clear the flag in disable()/enable() but also needs to set the flag in is_enable() to get initial status. The only benefit of keeping is_enabled flag is just save a register read when set_mode(). Remove is_enabled flag makes the code simpler. This patch also moves ab8500_regulator_is_enabled() close to ab8500_regulator_[en|dis]able functions. This is required to avoid a forward declaration because now we call ab8500_regulator_is_enabled() in ab8500_regulator_set_mode(). This change also makes the code better in readability by moving similar functions to one place. Signed-off-by: Axel Lin Acked-by: Lee Jones Signed-off-by: Mark Brown --- Reading git-diff-tree failed