Commit 23819f2e authored by Christophe Jaillet's avatar Christophe Jaillet Committed by Brian Norris

mtd: nand: mpc5121: use 'of_machine_is_compatible' to simplify code

The current code is the same as 'of_machine_is_compatible'.
So use it in order to remove a few lines of code and to be more
consistent with other parts of the kernel.
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent f9bdbd6c
...@@ -626,7 +626,7 @@ static void mpc5121_nfc_free(struct device *dev, struct mtd_info *mtd) ...@@ -626,7 +626,7 @@ static void mpc5121_nfc_free(struct device *dev, struct mtd_info *mtd)
static int mpc5121_nfc_probe(struct platform_device *op) static int mpc5121_nfc_probe(struct platform_device *op)
{ {
struct device_node *rootnode, *dn = op->dev.of_node; struct device_node *dn = op->dev.of_node;
struct clk *clk; struct clk *clk;
struct device *dev = &op->dev; struct device *dev = &op->dev;
struct mpc5121_nfc_prv *prv; struct mpc5121_nfc_prv *prv;
...@@ -712,18 +712,15 @@ static int mpc5121_nfc_probe(struct platform_device *op) ...@@ -712,18 +712,15 @@ static int mpc5121_nfc_probe(struct platform_device *op)
chip->ecc.mode = NAND_ECC_SOFT; chip->ecc.mode = NAND_ECC_SOFT;
/* Support external chip-select logic on ADS5121 board */ /* Support external chip-select logic on ADS5121 board */
rootnode = of_find_node_by_path("/"); if (of_machine_is_compatible("fsl,mpc5121ads")) {
if (of_device_is_compatible(rootnode, "fsl,mpc5121ads")) {
retval = ads5121_chipselect_init(mtd); retval = ads5121_chipselect_init(mtd);
if (retval) { if (retval) {
dev_err(dev, "Chipselect init error!\n"); dev_err(dev, "Chipselect init error!\n");
of_node_put(rootnode);
return retval; return retval;
} }
chip->select_chip = ads5121_select_chip; chip->select_chip = ads5121_select_chip;
} }
of_node_put(rootnode);
/* Enable NFC clock */ /* Enable NFC clock */
clk = devm_clk_get(dev, "ipg"); clk = devm_clk_get(dev, "ipg");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment