aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/pmc_atom.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-01-22 11:05:43 -0500
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-02-07 05:50:21 -0500
commita08f06bb7a0743a7fc8d571899c93d882468096e (patch)
tree27168380ec79b56895dbce004ffe940d0065450d /drivers/platform/x86/pmc_atom.c
parenta2e5790d841658485d642196dbb0927303d6c22f (diff)
seq_file: Introduce DEFINE_SHOW_ATTRIBUTE() helper macro
The DEFINE_SHOW_ATTRIBUTE() helper macro would be useful for current users, which are many of them, and for new comers to decrease code duplication. Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Darren Hart (VMware) <dvhart@infradead.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86/pmc_atom.c')
-rw-r--r--drivers/platform/x86/pmc_atom.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/drivers/platform/x86/pmc_atom.c b/drivers/platform/x86/pmc_atom.c
index 4b3c37b6288c..8f018b3f3cd4 100644
--- a/drivers/platform/x86/pmc_atom.c
+++ b/drivers/platform/x86/pmc_atom.c
@@ -208,20 +208,6 @@ static const struct pmc_data cht_data = {
208 .clks = cht_clks, 208 .clks = cht_clks,
209}; 209};
210 210
211#define DEFINE_SHOW_ATTRIBUTE(__name) \
212static int __name ## _open(struct inode *inode, struct file *file) \
213{ \
214 return single_open(file, __name ## _show, inode->i_private); \
215} \
216 \
217static const struct file_operations __name ## _fops = { \
218 .owner = THIS_MODULE, \
219 .open = __name ## _open, \
220 .read = seq_read, \
221 .llseek = seq_lseek, \
222 .release = single_release, \
223}
224
225static inline u32 pmc_reg_read(struct pmc_dev *pmc, int reg_offset) 211static inline u32 pmc_reg_read(struct pmc_dev *pmc, int reg_offset)
226{ 212{
227 return readl(pmc->regmap + reg_offset); 213 return readl(pmc->regmap + reg_offset);