drivers/hwmon: Isolate bus transfer protocol
RFC v2 2/2 drivers/hwmon: Isolate bus transfer protocol
From: "Edward A. James" <[email protected]>
- Copy i2c related code into occ_i2c.c and simplify.
- Copy common platform code into occ.c; more functions can be placed here later.
- Change core functions to accept OCC driver data parameter instead of device pointer.
--- drivers/hwmon/occ/Makefile | 2 +- drivers/hwmon/occ/occ.c | 127 +++++++++++++++ drivers/hwmon/occ/occ.h | 47 ++++++ drivers/hwmon/occ/occ_i2c.c | 150 ++++++++++++++++++ drivers/hwmon/occ/power8_occ.c | 343 +++++++++-------------------------------- drivers/hwmon/occ/power8_occ.h | 25 +++ 6 files changed, 422 insertions(+), 272 deletions(-) create mode 100644 drivers/hwmon/occ/occ.c create mode 100644 drivers/hwmon/occ/occ.h create mode 100644 drivers/hwmon/occ/occ_i2c.c create mode 100644 drivers/hwmon/occ/power8_occ.h
drivers/hwmon/occ/Makefile +1 -1
@@ -1 +1 @@ -obj-$(CONFIG_OCC) += power8_occ.o +obj-$(CONFIG_OCC) += occ.o occ_i2c.o power8_occ.o
drivers/hwmon/occ/occ.c new file +127 -0
127 lines not on this page · raw message
drivers/hwmon/occ/occ.h new file +47 -0
47 lines not on this page · raw message
drivers/hwmon/occ/occ_i2c.c new file +150 -0
150 lines not on this page · raw message
drivers/hwmon/occ/power8_occ.c +72 -271
608 lines not on this page · raw message
drivers/hwmon/occ/power8_occ.h new file +25 -0
@@ -0,0 +1,25 @@ +/* +* power8_occ.h - Power8 OCC hwmon driver +* +* This file contains Power8 specific function prototypes +* +* Copyright 2016 IBM Corp. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#ifndef __POWER8_OCC_H__ +#define __POWER8_OCC_H__ + +int occ_init (struct occ_driver *driver); +void occ_exit (struct occ_driver *driver); + +#endif /* __POWER8_OCC_H__ */
Signature · 1 line
1.9.1
Hey Eddie,
Quoted 7 lines · On Wed, Oct 12, 2016 at 8:42 AM, <[email protected]> wrote:
From: "Edward A. James" <[email protected]>
- Copy i2c related code into
occ_i2c.cand simplify.
- Copy common platform code intoocc.c; more functions can be placed here later.
- Change core functions to accept OCC driver data parameter instead of device pointer.
As a general rule, if you find yourself writing a series of bullet points in a commit message, then that commit should be split up into one patch for each bullet point. This list is a good example of such a case.
I had a brief read of the patch, and I noticed many of the comments are descriptions of what some very straightforward code is doing. I think you can drop the comments in this case; consider adding another patch that removes such comments.
Cheers,
Joel
Quoted 14 lines
Signed-off-by Edward A. James <[email protected]>--- drivers/hwmon/occ/Makefile | 2 +- drivers/hwmon/occ/occ.c | 127 +++++++++++++++ drivers/hwmon/occ/occ.h | 47 ++++++ drivers/hwmon/occ/occ_i2c.c | 150 ++++++++++++++++++ drivers/hwmon/occ/power8_occ.c | 343 +++++++++-------------------------------- drivers/hwmon/occ/power8_occ.h | 25 +++ 6 files changed, 422 insertions(+), 272 deletions(-) create mode 100644 drivers/hwmon/occ/occ.c create mode 100644 drivers/hwmon/occ/occ.h create mode 100644 drivers/hwmon/occ/occ_i2c.c create mode 100644 drivers/hwmon/occ/power8_occ.h