mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:46:10 +00:00
hw/misc/aspeed_peci: convert to use Resettable interface
Replace the legacy reset callback registered via device_class_set_legacy_reset() with the Resettable interface. Signed-off-by: Kane Chen <kane_chen@aspeedtech.com> Reviewed-by: Jamin Lin <jamin_lin@aspeedtech.com> Link: https://lore.kernel.org/qemu-devel/20260525044129.3133916-3-kane_chen@aspeedtech.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
committed by
Cédric Le Goater
parent
17682fa279
commit
f78e636187
@@ -123,9 +123,9 @@ static void aspeed_peci_realize(DeviceState *dev, Error **errp)
|
||||
sysbus_init_irq(sbd, &s->irq);
|
||||
}
|
||||
|
||||
static void aspeed_peci_reset(DeviceState *dev)
|
||||
static void aspeed_peci_reset_hold(Object *obj, ResetType type)
|
||||
{
|
||||
AspeedPECIState *s = ASPEED_PECI(dev);
|
||||
AspeedPECIState *s = ASPEED_PECI(obj);
|
||||
|
||||
memset(s->regs, 0, sizeof(s->regs));
|
||||
}
|
||||
@@ -133,9 +133,10 @@ static void aspeed_peci_reset(DeviceState *dev)
|
||||
static void aspeed_peci_class_init(ObjectClass *klass, const void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
ResettableClass *rc = RESETTABLE_CLASS(klass);
|
||||
|
||||
dc->realize = aspeed_peci_realize;
|
||||
device_class_set_legacy_reset(dc, aspeed_peci_reset);
|
||||
rc->phases.hold = aspeed_peci_reset_hold;
|
||||
dc->desc = "Aspeed PECI Controller";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user