mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-28 23:50:26 +09:00
mailbox: stm32_ipcc: Convert to use APIs which support live DT
Use ofnode_ or dev_ APIs instead of fdt_ and fdtdec_ APIs so that the driver can support live DT. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
This commit is contained in:
parent
a04616be1b
commit
04e29ca5bb
@ -101,9 +101,8 @@ static int stm32_ipcc_probe(struct udevice *dev)
|
|||||||
{
|
{
|
||||||
struct stm32_ipcc *ipcc = dev_get_priv(dev);
|
struct stm32_ipcc *ipcc = dev_get_priv(dev);
|
||||||
fdt_addr_t addr;
|
fdt_addr_t addr;
|
||||||
const fdt32_t *cell;
|
|
||||||
struct clk clk;
|
struct clk clk;
|
||||||
int len, ret;
|
int ret;
|
||||||
|
|
||||||
debug("%s(dev=%p)\n", __func__, dev);
|
debug("%s(dev=%p)\n", __func__, dev);
|
||||||
|
|
||||||
@ -114,14 +113,12 @@ static int stm32_ipcc_probe(struct udevice *dev)
|
|||||||
ipcc->reg_base = (void __iomem *)addr;
|
ipcc->reg_base = (void __iomem *)addr;
|
||||||
|
|
||||||
/* proc_id */
|
/* proc_id */
|
||||||
cell = dev_read_prop(dev, "st,proc_id", &len);
|
ret = dev_read_u32_index(dev, "st,proc_id", 1, &ipcc->proc_id);
|
||||||
if (len < sizeof(fdt32_t)) {
|
if (ret) {
|
||||||
dev_dbg(dev, "Missing st,proc_id\n");
|
dev_dbg(dev, "Missing st,proc_id\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ipcc->proc_id = fdtdec_get_number(cell, 1);
|
|
||||||
|
|
||||||
if (ipcc->proc_id >= STM32_MAX_PROCS) {
|
if (ipcc->proc_id >= STM32_MAX_PROCS) {
|
||||||
dev_err(dev, "Invalid proc_id (%d)\n", ipcc->proc_id);
|
dev_err(dev, "Invalid proc_id (%d)\n", ipcc->proc_id);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
Loading…
Reference in New Issue
Block a user