Changeset 360fb2f in rtems


Ignore:
Timestamp:
Aug 22, 2017, 10:28:10 AM (20 months ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
master
Children:
7f13fae8
Parents:
1ccce05
git-author:
Daniel Hellstrom <daniel@…> (08/22/17 10:28:10)
git-committer:
Daniel Hellstrom <daniel@…> (08/29/17 06:44:13)
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.

Updates #2331 but needs to be applied to 4.11 according to ticket.

File:
1 edited

Legend:

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

    r1ccce05 r360fb2f  
    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.