Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 288880
b: refs/heads/master
c: 9f3519d
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown authored and Greg Kroah-Hartman committed Feb 16, 2012
1 parent d6a887a commit 3b9ebc6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bc5bca53cca350eb90fc9f84c2e37ba6383807c3
refs/heads/master: 9f3519d2ed26d2ede5b6432fb64af0e7e8ed13e3
17 changes: 12 additions & 5 deletions trunk/drivers/w1/slaves/w1_bq27000.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/types.h>
#include <linux/platform_device.h>
#include <linux/mutex.h>
#include <linux/power/bq27x00_battery.h>

#include "../w1.h"
#include "../w1_int.h"
Expand All @@ -39,10 +40,10 @@ void w1_bq27000_write(struct device *dev, u8 buf, u8 reg)
}
EXPORT_SYMBOL(w1_bq27000_write);

int w1_bq27000_read(struct device *dev, u8 reg)
static int w1_bq27000_read(struct device *dev, unsigned int reg)
{
u8 val;
struct w1_slave *sl = container_of(dev, struct w1_slave, dev);
struct w1_slave *sl = container_of(dev->parent, struct w1_slave, dev);

if (!dev)
return 0;
Expand All @@ -52,19 +53,25 @@ int w1_bq27000_read(struct device *dev, u8 reg)

return val;
}
EXPORT_SYMBOL(w1_bq27000_read);

static struct bq27000_platform_data bq27000_battery_info = {
.read = w1_bq27000_read,
.name = "bq27000-battery",
};

static int w1_bq27000_add_slave(struct w1_slave *sl)
{
int ret;
int id = 1;
struct platform_device *pdev;

pdev = platform_device_alloc("bq27000-battery", id);
pdev = platform_device_alloc("bq27000-battery", -1);
if (!pdev) {
ret = -ENOMEM;
return ret;
}
ret = platform_device_add_data(pdev,
&bq27000_battery_info,
sizeof(bq27000_battery_info));
pdev->dev.parent = &sl->dev;

ret = platform_device_add(pdev);
Expand Down

0 comments on commit 3b9ebc6

Please sign in to comment.