From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753125Ab1JJJXt (ORCPT ); Mon, 10 Oct 2011 05:23:49 -0400 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:51367 "EHLO opensource.wolfsonmicro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753019Ab1JJJXt (ORCPT ); Mon, 10 Oct 2011 05:23:49 -0400 Date: Mon, 10 Oct 2011 10:23:46 +0100 From: Mark Brown To: Dimitris Papastamos Cc: linux-kernel@vger.kernel.org, patches@opensource.wolfsonmicro.com Subject: Re: [PATCH 2/2] regmap: Allow caches for devices with no defaults Message-ID: <20111010092345.GA3040@opensource.wolfsonmicro.com> References: <1318167876-17801-1-git-send-email-broonie@opensource.wolfsonmicro.com> <1318167876-17801-2-git-send-email-broonie@opensource.wolfsonmicro.com> <20111010084126.GA2563@opensource.wolfsonmicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111010084126.GA2563@opensource.wolfsonmicro.com> X-Cookie: Exercise caution in your daily affairs. User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 10, 2011 at 09:41:26AM +0100, Dimitris Papastamos wrote: > On Sun, Oct 09, 2011 at 02:44:36PM +0100, Mark Brown wrote: > > + } else if (map->num_reg_defaults_raw) { > > /* Some devices such as PMICs don't have cache defaults, > > * we cope with this by reading back the HW registers and > > * crafting the cache defaults by hand. > We could probably then also remove the first check in > regcache_hw_init() I guess. > The one: > if (!map->num_reg_defaults_raw) > return -EINVAL; I felt it was clearer to have the defaults init fail if it doesn't work so that the callers know what happened. Otherwise the callers have to figure out if it succeeded because it did what it was supposed to.