Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1406395

Re: [PATCH v5] platform:x86: Add PMC Driver for Intel Core SoC

From Andy Shevchenko <andy.shevchenko@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5] platform:x86: Add PMC Driver for Intel Core SoC
Date 2016-05-24 21:10 +0200
Message-ID <rCpSh-7fZ-11@gated-at.bofh.it> (permalink)
References <rClvp-4mV-13@gated-at.bofh.it> <rCpIC-6Xu-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, May 24, 2016 at 9:54 PM, Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Tue, May 24, 2016 at 5:25 PM, Rajneesh Bhardwaj
> <rajneesh.bhardwaj@intel.com> 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()

-- 
With Best Regards,
Andy Shevchenko

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5] platform:x86: Add PMC Driver for Intel Core SoC Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com> - 2016-05-24 16:30 +0200
  Re: [PATCH v5] platform:x86: Add PMC Driver for Intel Core SoC Andy Shevchenko <andy.shevchenko@gmail.com> - 2016-05-24 21:00 +0200
    Re: [PATCH v5] platform:x86: Add PMC Driver for Intel Core SoC Andy Shevchenko <andy.shevchenko@gmail.com> - 2016-05-24 21:10 +0200
      Re: [PATCH v5] platform:x86: Add PMC Driver for Intel Core SoC Darren Hart <dvhart@infradead.org> - 2016-05-24 21:50 +0200
        Re: [PATCH v5] platform:x86: Add PMC Driver for Intel Core SoC Andy Shevchenko <andy.shevchenko@gmail.com> - 2016-05-24 22:20 +0200
          Re: [PATCH v5] platform:x86: Add PMC Driver for Intel Core SoC Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com> - 2016-05-25 20:20 +0200
    Re: [PATCH v5] platform:x86: Add PMC Driver for Intel Core SoC Darren Hart <dvhart@infradead.org> - 2016-05-24 21:40 +0200
      Re: [PATCH v5] platform:x86: Add PMC Driver for Intel Core SoC Andy Shevchenko <andy.shevchenko@gmail.com> - 2016-05-24 22:20 +0200
        Re: [PATCH v5] platform:x86: Add PMC Driver for Intel Core SoC Darren Hart <dvhart@infradead.org> - 2016-05-24 22:50 +0200

csiph-web