From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932425AbcEXTnC (ORCPT ); Tue, 24 May 2016 15:43:02 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:57361 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751820AbcEXTnA (ORCPT ); Tue, 24 May 2016 15:43:00 -0400 Date: Tue, 24 May 2016 12:43:02 -0700 From: Darren Hart To: Andy Shevchenko Cc: Rajneesh Bhardwaj , platform-driver-x86@vger.kernel.org, "linux-kernel@vger.kernel.org" , Olof Johansson , Thomas Gleixner , "H. Peter Anvin" , dbasehore@google.com, vishwanath.somayaji@intel.com Subject: Re: [PATCH v5] platform:x86: Add PMC Driver for Intel Core SoC Message-ID: <20160524194302.GK2735@f23x64.localdomain> References: <1464099946-15078-1-git-send-email-rajneesh.bhardwaj@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 24, 2016 at 10:07:32PM +0300, Andy Shevchenko wrote: > On Tue, May 24, 2016 at 9:54 PM, Andy Shevchenko > wrote: > > On Tue, May 24, 2016 at 5:25 PM, Rajneesh Bhardwaj > > wrote: > > >> +static int pmc_core_dev_state_show(struct seq_file *s, void *unused) > >> +{ > >> + struct pmc_dev *pmcdev = s->private; > >> + u32 counter_val; > >> + > >> + counter_val = pmc_core_reg_read(pmcdev, > >> + SPT_PMC_SLP_S0_RES_COUNTER_OFFSET); > >> + seq_printf(s, "%u\n", pmc_core_adjust_slp_s0_step(counter_val)); > >> + > >> + return 0; > >> +} > >> + > >> +static int pmc_core_dev_state_open(struct inode *inode, struct file *file) > >> +{ > >> + return single_open(file, pmc_core_dev_state_show, inode->i_private); > >> +} > >> + > >> +static const struct file_operations pmc_core_dev_state_ops = { > >> + .open = pmc_core_dev_state_open, > >> + .read = seq_read, > >> + .llseek = seq_lseek, > >> + .release = single_release, > >> +}; > > > > I suppose DEFINE_SIMPLE_ATTRIBUTE might reduce amount of LOC. > > Correction: > DEFINE_DEBUGFS_ATTRIBUTE() Andy caught the couple things I was going to add and a couple more. Please give his feedback one more pass (except where I noted we had already covered things like the header and the module build), and we should still be able to get this into 4.7 if I have the next rev by tomorrow. -- Darren Hart Intel Open Source Technology Center