Changeset b39cda6 in rtems


Ignore:
Timestamp:
Oct 6, 2017, 10:03:03 AM (22 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
e316be7
Parents:
8bdbefe
git-author:
Sebastian Huber <sebastian.huber@…> (10/06/17 10:03:03)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/06/17 10:49:29)
Message:

bsp/imx: Fix I2C registration with path

Update #3090.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/imx/i2c/imx-i2c.c

    r8bdbefe rb39cda6  
    401401}
    402402
    403 int i2c_bus_register_imx(const char *bus_path, const char *alias)
     403int i2c_bus_register_imx(const char *bus_path, const char *alias_or_path)
    404404{
    405405  const void *fdt;
     406  const char *path;
    406407  int node;
    407408  imx_i2c_bus *bus;
     
    409410
    410411  fdt = bsp_fdt_get();
    411   alias = fdt_get_alias(fdt, alias);
    412 
    413   if (alias == NULL) {
     412  path = fdt_get_alias(fdt, alias_or_path);
     413
     414  if (path == NULL) {
     415    path = alias_or_path;
     416  }
     417
     418  node = fdt_path_offset(fdt, path);
     419  if (node < 0) {
    414420    rtems_set_errno_and_return_minus_one(ENXIO);
    415421  }
     
    420426  }
    421427
    422   node = fdt_path_offset(fdt, alias);
    423428  bus->regs = imx_get_reg_of_node(fdt, node);
    424429  bus->irq = imx_get_irq_of_node(fdt, node, 0);
Note: See TracChangeset for help on using the changeset viewer.