Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752665AbbLKBKn (ORCPT ); Thu, 10 Dec 2015 20:10:43 -0500 Received: from cmccmta2.chinamobile.com ([221.176.66.80]:3366 "EHLO cmccmta2.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750994AbbLKBKm (ORCPT ); Thu, 10 Dec 2015 20:10:42 -0500 X-RM-TRANSID: 2ee6566a228f477-0fc77 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee4566a228e385-4da44 Message-ID: <566A22B3.3040904@cmss.chinamobile.com> Date: Fri, 11 Dec 2015 09:11:15 +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: Charles Keepax CC: broonie@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] regmap: cache: Add warning info for the cache check References: <1449715253-4517-1-git-send-email-lixiubo@cmss.chinamobile.com> <20151210124535.GO6058@localhost.localdomain> In-Reply-To: <20151210124535.GO6058@localhost.localdomain> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1437 Lines: 53 On 10/12/2015 20:45, Charles Keepax wrote: > On Thu, Dec 10, 2015 at 10:40:53AM +0800, Xiubo Li wrote: >> If there is no cache used for the drivers, the register drfaults > s/drfaults/defaults/ Yes,Thanks. >> are not need any more. This patch will check this and print a >> warning. >> >> Signed-off-by: Xiubo Li >> --- >> drivers/base/regmap/regcache.c | 12 ++++++++---- >> 1 file changed, 8 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c >> index 1c0210a..bdcd401 100644 >> --- a/drivers/base/regmap/regcache.c >> +++ b/drivers/base/regmap/regcache.c >> @@ -100,15 +100,19 @@ int regcache_init(struct regmap *map, const struct regmap_config *config) >> int i; >> void *tmp_buf; >> >> - 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) { >> + if (config->num_reg_defaults) >> + dev_warn(map->dev, >> + "No cache used with register defualts set!\n"); > s/defualts/defaults/ See the next version. Thanks, BRs Xiubo > Thanks, > Charles -- 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/