g762.c (398e16db62620dd80a237c5043bec5c9335ac92c) g762.c (fce9626cd93abaf1ef21b361f8a0fa493cc855b2)
1/*
2 * g762 - Driver for the Global Mixed-mode Technology Inc. fan speed
3 * PWM controller chips from G762 family, i.e. G762 and G763
4 *
5 * Copyright (C) 2013, Arnaud EBALARD <arno@natisbad.org>
6 *
7 * This work is based on a basic version for 2.6.31 kernel developed
8 * by Olivier Mouchet for LaCie. Updates and correction have been

--- 635 unchanged lines hidden (view full) ---

644 clk_put(data->clk);
645}
646
647static int g762_of_prop_import_one(struct i2c_client *client,
648 const char *pname,
649 int (*psetter)(struct device *dev,
650 unsigned long val))
651{
1/*
2 * g762 - Driver for the Global Mixed-mode Technology Inc. fan speed
3 * PWM controller chips from G762 family, i.e. G762 and G763
4 *
5 * Copyright (C) 2013, Arnaud EBALARD <arno@natisbad.org>
6 *
7 * This work is based on a basic version for 2.6.31 kernel developed
8 * by Olivier Mouchet for LaCie. Updates and correction have been

--- 635 unchanged lines hidden (view full) ---

644 clk_put(data->clk);
645}
646
647static int g762_of_prop_import_one(struct i2c_client *client,
648 const char *pname,
649 int (*psetter)(struct device *dev,
650 unsigned long val))
651{
652 const __be32 *prop;
653 int len, ret;
652 int ret;
654 u32 pval;
655
653 u32 pval;
654
656 prop = of_get_property(client->dev.of_node, pname, &len);
657 if (!prop || len != sizeof(u32))
655 if (of_property_read_u32(client->dev.of_node, pname, &pval))
658 return 0;
659
656 return 0;
657
660 pval = be32_to_cpu(prop[0]);
661 dev_dbg(&client->dev, "found %s (%d)\n", pname, pval);
662 ret = (*psetter)(&client->dev, pval);
663 if (ret)
664 dev_err(&client->dev, "unable to set %s (%d)\n", pname, pval);
665
666 return ret;
667}
668

--- 464 unchanged lines hidden ---
658 dev_dbg(&client->dev, "found %s (%d)\n", pname, pval);
659 ret = (*psetter)(&client->dev, pval);
660 if (ret)
661 dev_err(&client->dev, "unable to set %s (%d)\n", pname, pval);
662
663 return ret;
664}
665

--- 464 unchanged lines hidden ---