Changeset a100457 in rtems


Ignore:
Timestamp:
08/22/17 10:28:10 (7 years ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
4.11
Children:
63c6b06f
Parents:
55d9d8c
git-author:
Daniel Hellstrom <daniel@…> (08/22/17 10:28:10)
git-committer:
Chris Johns <chrisj@…> (10/01/20 01:35:03)
Message:

leon,gr1553b: improve init check

Check in init3 not needed since same data is already checked in init2
stage. Adds an extra check that the APB register space is available before
accessing it.

Closes #2331

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/shared/1553/gr1553b.c

    r55d9d8c ra100457  
    192192        }
    193193        pnpinfo = &ambadev->info;
     194        if ( pnpinfo->apb_slv == NULL )
     195                return DRVMGR_EIO;
    194196        regs = (struct gr1553b_regs *)pnpinfo->apb_slv->start;
    195197
     
    228230        /* Get device information from AMBA PnP information */
    229231        ambadev = (struct amba_dev_info *)dev->businfo;
    230         if ( ambadev == NULL ) {
    231                 return DRVMGR_FAIL;
    232         }
    233232        pnpinfo = &ambadev->info;
    234233        regs = (struct gr1553b_regs *)pnpinfo->apb_slv->start;
     
    256255                /* Init Minor and Next */
    257256                gr1553_list_add(&gr1553_rt_root, feat);
     257        }
     258
     259        if ( priv->features == 0 ) {
     260                /* no features in HW should never happen.. an I/O error? */
     261                free(priv);
     262                return DRVMGR_EIO;
    258263        }
    259264
Note: See TracChangeset for help on using the changeset viewer.