Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753146AbbLID0D (ORCPT ); Tue, 8 Dec 2015 22:26:03 -0500 Received: from cmccmta3.chinamobile.com ([221.176.66.81]:9822 "EHLO cmccmta3.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752975AbbLID0A (ORCPT ); Tue, 8 Dec 2015 22:26:00 -0500 X-Greylist: delayed 544 seconds by postgrey-1.27 at vger.kernel.org; Tue, 08 Dec 2015 22:25:59 EST X-RM-TRANSID: 2ee956679d1f0d7-3f7ff X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2eea56679d1ff01-de141 Message-ID: <56679D42.3030708@cmss.chinamobile.com> Date: Wed, 09 Dec 2015 11:17:22 +0800 From: Xiubo Li User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Mark Brown CC: linux-kernel@vger.kernel.org Subject: Re: [PATCH] regmap: speed up the regcache_init() References: <1449109150-26793-1-git-send-email-lixiubo@cmss.chinamobile.com> <20151208170517.GU5727@sirena.org.uk> In-Reply-To: <20151208170517.GU5727@sirena.org.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1286 Lines: 45 On 09/12/2015 01:05, Mark Brown wrote: > On Thu, Dec 03, 2015 at 10:19:10AM +0800, Xiubo Li wrote: > >> If the cache is not used by the device driver, there is not need to >> check the striding of the registers. It will just return 0 from >> regcache_init() and let the register striding be checked in proper >> place when needed. >> - for (i = 0; i < config->num_reg_defaults; i++) >> - if (config->reg_defaults[i].reg % map->reg_stride) >> - return -EINVAL; >> - >> if (map->cache_type == REGCACHE_NONE) { >> map->cache_bypass = true; >> return 0; >> } > If we're not using the register cache why are there defaults in the > first place? Yes, usually when the register cache is not used, the number of the defaults should be zero, but for some drivers like drv2267.c/led_lp8860.c will add the defaults register values though the cache type is REGCACHE_NONE for some reasons. This patch may be not the best, but will be a bit meaningful for some drivers like drv2267.c/led_lp8860.c for now. Thanks, BRs Xiubo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/