hw/usb/ccid: Make ccid_card_init() take an error parameter

Replace init() of CCIDCardClass with realize, then convert
ccid_card_init(), ccid_card_initfn() and it's callbacks to
take an Error** in ordor to report the error more clearly.

Signed-off-by: Mao Zhongyi <maozy.fnst@cn.fujitsu.com>
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20180125171432.13554-2-f4bug@amsat.org
[PMD: fixed s->card assignation in ccid_card_realize()]
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Mao Zhongyi 2018-01-25 14:14:30 -03:00 committed by Gerd Hoffmann
parent 395b953959
commit cc847bfd16
4 changed files with 50 additions and 45 deletions

View file

@ -34,7 +34,7 @@ typedef struct CCIDCardClass {
const uint8_t *apdu,
uint32_t len);
void (*exitfn)(CCIDCardState *card);
int (*initfn)(CCIDCardState *card);
void (*realize)(CCIDCardState *card, Error **errp);
} CCIDCardClass;
/*