Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142010
b: refs/heads/master
c: 7d33ccb
h: refs/heads/master
v: v3
  • Loading branch information
Philipp Zabel authored and Samuel Ortiz committed Apr 4, 2009
1 parent 98babfe commit c3e292d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 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: b72019dbd126e60bb5f9f350f76127b1527facba
refs/heads/master: 7d33ccbeecd8393cc690cf9a71008236cdd7cc2c
27 changes: 7 additions & 20 deletions trunk/drivers/w1/masters/ds1wm.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <linux/irq.h>
#include <linux/pm.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/delay.h>
#include <linux/mfd/core.h>
Expand Down Expand Up @@ -93,7 +92,6 @@ struct ds1wm_data {
struct mfd_cell *cell;
int irq;
int active_high;
struct clk *clk;
int slave_present;
void *reset_complete;
void *read_complete;
Expand Down Expand Up @@ -216,17 +214,17 @@ static int ds1wm_find_divisor(int gclk)

static void ds1wm_up(struct ds1wm_data *ds1wm_data)
{
int gclk, divisor;
int divisor;
struct ds1wm_driver_data *plat = ds1wm_data->cell->driver_data;

if (ds1wm_data->cell->enable)
ds1wm_data->cell->enable(ds1wm_data->pdev);

gclk = clk_get_rate(ds1wm_data->clk);
clk_enable(ds1wm_data->clk);
divisor = ds1wm_find_divisor(gclk);
divisor = ds1wm_find_divisor(plat->clock_rate);
if (divisor == 0) {
dev_err(&ds1wm_data->pdev->dev,
"no suitable divisor for %dHz clock\n", gclk);
"no suitable divisor for %dHz clock\n",
plat->clock_rate);
return;
}
ds1wm_write_register(ds1wm_data, DS1WM_CLKDIV, divisor);
Expand All @@ -247,8 +245,6 @@ static void ds1wm_down(struct ds1wm_data *ds1wm_data)

if (ds1wm_data->cell->disable)
ds1wm_data->cell->disable(ds1wm_data->pdev);

clk_disable(ds1wm_data->clk);
}

/* --------------------------------------------------------------------- */
Expand Down Expand Up @@ -385,26 +381,18 @@ static int ds1wm_probe(struct platform_device *pdev)
if (ret)
goto err1;

ds1wm_data->clk = clk_get(&pdev->dev, "ds1wm");
if (IS_ERR(ds1wm_data->clk)) {
ret = PTR_ERR(ds1wm_data->clk);
goto err2;
}

ds1wm_up(ds1wm_data);

ds1wm_master.data = (void *)ds1wm_data;

ret = w1_add_master_device(&ds1wm_master);
if (ret)
goto err3;
goto err2;

return 0;

err3:
ds1wm_down(ds1wm_data);
clk_put(ds1wm_data->clk);
err2:
ds1wm_down(ds1wm_data);
free_irq(ds1wm_data->irq, ds1wm_data);
err1:
iounmap(ds1wm_data->map);
Expand Down Expand Up @@ -443,7 +431,6 @@ static int ds1wm_remove(struct platform_device *pdev)

w1_remove_master_device(&ds1wm_master);
ds1wm_down(ds1wm_data);
clk_put(ds1wm_data->clk);
free_irq(ds1wm_data->irq, ds1wm_data);
iounmap(ds1wm_data->map);
kfree(ds1wm_data);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/mfd/ds1wm.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

struct ds1wm_driver_data {
int active_high;
int clock_rate;
};

0 comments on commit c3e292d

Please sign in to comment.