On 1/8/25 00:25, John Erasmus Mari Geronimo wrote:
Utilized chip info to replace enum chips to cater similar devices with
different configurations.
Signed-off-by: John Erasmus Mari Geronimo <johnerasmusmari.geronimo@xxxxxxxxxx>
---
drivers/hwmon/max31827.c | 86 ++++++++++++++++++++--------------------
1 file changed, 43 insertions(+), 43 deletions(-)
diff --git a/drivers/hwmon/max31827.c b/drivers/hwmon/max31827.c
index 48e8f8ba4..5d319d401 100644
--- a/drivers/hwmon/max31827.c
+++ b/drivers/hwmon/max31827.c
@@ -47,12 +47,6 @@
#define MAX31827_M_DGR_TO_16_BIT(x) (((x) << 4) / 1000)
#define MAX31827_DEVICE_ENABLE(x) ((x) ? 0xA : 0x0)
-/*
- * The enum passed in the .data pointer of struct of_device_id must
- * start with a value != 0 since that is a requirement for using
- * device_get_match_data().
- */
-enum chips { max31827 = 1, max31828, max31829 };
enum max31827_cnv {
MAX31827_CNV_1_DIV_64_HZ = 1,
@@ -95,6 +89,17 @@ static const u16 max31827_conv_times[] = {
[MAX31827_RES_12_BIT] = MAX31827_12_BIT_CNV_TIME,
};
+struct max31827_state;
+static const struct max31827_chip_info max31827;
+static const struct max31827_chip_info max31828;
+static const struct max31827_chip_info max31829;
+static const struct max31827_chip_info max31875;
+
From Documentation/hwmon/submitting-patches.rst:
* Avoid forward declarations if you can. Rearrange the code if necessary.
Please follow that guidance.
Thanks,
Guenter