spi: Tidy up get/set of device node
This code is a bit odd in that it only reads and updates the livetree version of the device ofnode. This means it won't work with flattree. Update the code to work as it was presumably intended. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -412,6 +412,7 @@ spinand_to_nand(struct spinand_device *spinand)
|
||||
return &spinand->base;
|
||||
}
|
||||
|
||||
#ifndef __UBOOT__
|
||||
/**
|
||||
* spinand_set_of_node - Attach a DT node to a SPI NAND device
|
||||
* @spinand: SPI NAND device
|
||||
@@ -424,6 +425,20 @@ static inline void spinand_set_of_node(struct spinand_device *spinand,
|
||||
{
|
||||
nanddev_set_of_node(&spinand->base, np);
|
||||
}
|
||||
#else
|
||||
/**
|
||||
* spinand_set_of_node - Attach a DT node to a SPI NAND device
|
||||
* @spinand: SPI NAND device
|
||||
* @node: ofnode
|
||||
*
|
||||
* Attach a DT node to a SPI NAND device.
|
||||
*/
|
||||
static inline void spinand_set_ofnode(struct spinand_device *spinand,
|
||||
ofnode node)
|
||||
{
|
||||
nanddev_set_ofnode(&spinand->base, node);
|
||||
}
|
||||
#endif /* __UBOOT__ */
|
||||
|
||||
int spinand_match_and_init(struct spinand_device *dev,
|
||||
const struct spinand_info *table,
|
||||
|
Reference in New Issue
Block a user