Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754128AbbLJMpr (ORCPT ); Thu, 10 Dec 2015 07:45:47 -0500 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:60882 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751331AbbLJMpq (ORCPT ); Thu, 10 Dec 2015 07:45:46 -0500 Date: Thu, 10 Dec 2015 12:45:36 +0000 From: Charles Keepax To: Xiubo Li CC: , Subject: Re: [PATCH] regmap: cache: Add warning info for the cache check Message-ID: <20151210124535.GO6058@localhost.localdomain> References: <1449715253-4517-1-git-send-email-lixiubo@cmss.chinamobile.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1449715253-4517-1-git-send-email-lixiubo@cmss.chinamobile.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1507310000 definitions=main-1512100208 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1293 Lines: 39 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/ > 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/ 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/