xref: /rk3399_rockchip-uboot/include/mtd.h (revision d85879938d3fc3557f6ff74a60f95e0975a314ce)
1*d8587993SThomas Chou /*
2*d8587993SThomas Chou  * Copyright (C) 2015 Thomas Chou <thomas@wytron.com.tw>
3*d8587993SThomas Chou  *
4*d8587993SThomas Chou  * SPDX-License-Identifier:	GPL-2.0+
5*d8587993SThomas Chou  */
6*d8587993SThomas Chou 
7*d8587993SThomas Chou #ifndef _MTD_H_
8*d8587993SThomas Chou #define _MTD_H_
9*d8587993SThomas Chou 
10*d8587993SThomas Chou #include <linux/mtd/mtd.h>
11*d8587993SThomas Chou 
12*d8587993SThomas Chou /*
13*d8587993SThomas Chou  * Get mtd_info structure of the dev, which is stored as uclass private.
14*d8587993SThomas Chou  *
15*d8587993SThomas Chou  * @dev: The MTD device
16*d8587993SThomas Chou  * @return: pointer to mtd_info, NULL on error
17*d8587993SThomas Chou  */
18*d8587993SThomas Chou static inline struct mtd_info *mtd_get_info(struct udevice *dev)
19*d8587993SThomas Chou {
20*d8587993SThomas Chou 	return dev_get_uclass_priv(dev);
21*d8587993SThomas Chou }
22*d8587993SThomas Chou 
23*d8587993SThomas Chou #endif	/* _MTD_H_ */
24