From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756481Ab2ECKWz (ORCPT ); Thu, 3 May 2012 06:22:55 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:49058 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752846Ab2ECKWx (ORCPT ); Thu, 3 May 2012 06:22:53 -0400 From: Johan Hovold To: Mark Brown Cc: Samuel Ortiz , Florian Tobias Schandinat , Arnd Bergmann , Greg Kroah-Hartman , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Morton , Richard Purdie , Johan Hovold Subject: Re: [PATCH 1/4] mfd: add LM3533 lighting-power core driver Date: Thu, 3 May 2012 12:22:40 +0200 Message-Id: <1336040560-18185-1-git-send-email-jhovold@gmail.com> X-Mailer: git-send-email 1.7.8.5 In-Reply-To: <20120426124122.GA26692@sirena.org.uk> References: <20120426124122.GA26692@sirena.org.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Sorry for the resend -- Android/gmail apparently added HTML to my previous attempt. ] On Apr 26, 2012 2:41 PM, "Mark Brown" wrote: > On Fri, Apr 20, 2012 at 05:30:23PM +0200, Johan Hovold wrote: > > +static int __lm3533_read(struct lm3533 *lm3533, u8 reg, u8 *val) > > +{ > > + int ret; > > + > > + ret = lm3533->read(lm3533, reg, val); > > + if (ret < 0) { > > Looks like you could save a bunch of code by using regmap for the > register I/O. This would also give you access to the cache and > diagnostic infrastructure it has. Using regmap only saves about ten lines for the actual io implementation, but it does allow me to get rid of the custom debugfs interface. I'm not enabling caching at this point but it'll probably come in handy later. Thanks, Johan