Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308286
b: refs/heads/master
c: 9c2bd50
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Lunn authored and Mike Turquette committed May 8, 2012
1 parent b659669 commit 2383241
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8c869edaee07c623066266827371235fb9c12e01
refs/heads/master: 9c2bd504b55ce3e680ae0d3768e78c15fef3448d
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-kirkwood/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ void __init kirkwood_clk_init(void)
orion_clkdev_add("0", "sata_mv.0", sata0);
orion_clkdev_add("1", "sata_mv.0", sata1);
orion_clkdev_add(NULL, "orion-ehci.0", usb0);
orion_clkdev_add(NULL, "orion_nand", runit);
}

/*****************************************************************************
Expand Down
18 changes: 18 additions & 0 deletions trunk/drivers/mtd/nand/orion_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <asm/io.h>
#include <asm/sizes.h>
#include <mach/hardware.h>
Expand Down Expand Up @@ -77,6 +79,7 @@ static int __init orion_nand_probe(struct platform_device *pdev)
struct nand_chip *nc;
struct orion_nand_data *board;
struct resource *res;
struct clk *clk;
void __iomem *io_base;
int ret = 0;

Expand Down Expand Up @@ -123,6 +126,14 @@ static int __init orion_nand_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, mtd);

/* Not all platforms can gate the clock, so it is not
an error if the clock does not exists. */
clk = clk_get(&pdev->dev, NULL);
if (!IS_ERR(clk)) {
clk_prepare_enable(clk);
clk_put(clk);
}

if (nand_scan(mtd, 1)) {
ret = -ENXIO;
goto no_dev;
Expand Down Expand Up @@ -151,13 +162,20 @@ static int __devexit orion_nand_remove(struct platform_device *pdev)
{
struct mtd_info *mtd = platform_get_drvdata(pdev);
struct nand_chip *nc = mtd->priv;
struct clk *clk;

nand_release(mtd);

iounmap(nc->IO_ADDR_W);

kfree(nc);

clk = clk_get(&pdev->dev, NULL);
if (!IS_ERR(clk)) {
clk_disable_unprepare(clk);
clk_put(clk);
}

return 0;
}

Expand Down

0 comments on commit 2383241

Please sign in to comment.