qemu/hw/sd/sd.c
/* Legacy initialization function for use by non-qdevified callers */
Legacy initialization function for use by non-qdevified callers
Legacy initialization function for use by non - qdevified callers
SDState *sd_init(BlockBackend *blk, bool is_spi)
{
    Object *obj;
    DeviceState *dev;
    Error *err = NULL;
    obj = object_new(TYPE_SD_CARD);
    dev = DEVICE(obj);
    qdev_prop_set_drive(dev, "drive", blk, &err);
    if (err) {
        error_report("sd_init failed: %s", error_get_pretty(err));
        return NULL;
    }
    qdev_prop_set_bit(dev, "spi", is_spi);
    object_property_set_bool(obj, true, "realized", &err);
    if (err) {
        error_report("sd_init failed: %s", error_get_pretty(err));
        return NULL;
    }
    return SD_CARD(dev);
}
SDState * sd_init ( BlockBackend * blk , bool is_spi ) { Object * obj ; DeviceState * dev ; Error * err = NULL ; obj = object_new ( TYPE_SD_CARD ) ; dev = DEVICE ( obj ) ; qdev_prop_set_drive ( dev , " " , blk , & err ) ; if ( err ) { error_report ( " " , error_get_pretty ( err ) ) ; return NULL ; } qdev_prop_set_bit ( dev , " " , is_spi ) ; object_property_set_bool ( obj , true , " " , & err ) ; if ( err ) { error_report ( " " , error_get_pretty ( err ) ) ; return NULL ; } return SD_CARD ( dev ) ; }
Legacy initialization function for use by non-qdevified callers
Legacy initialization function for use by non - qdevified callers