Lines Matching refs:sp
54 struct service_processor *sp; in ibmasm_init_one() local
67 sp = kzalloc(sizeof(struct service_processor), GFP_KERNEL); in ibmasm_init_one()
68 if (sp == NULL) { in ibmasm_init_one()
74 spin_lock_init(&sp->lock); in ibmasm_init_one()
75 INIT_LIST_HEAD(&sp->command_queue); in ibmasm_init_one()
77 pci_set_drvdata(pdev, (void *)sp); in ibmasm_init_one()
78 sp->dev = &pdev->dev; in ibmasm_init_one()
79 sp->number = pdev->bus->number; in ibmasm_init_one()
80 snprintf(sp->dirname, IBMASM_NAME_SIZE, "%d", sp->number); in ibmasm_init_one()
81 snprintf(sp->devname, IBMASM_NAME_SIZE, "%s%d", DRIVER_NAME, sp->number); in ibmasm_init_one()
83 result = ibmasm_event_buffer_init(sp); in ibmasm_init_one()
85 dev_err(sp->dev, "Failed to allocate event buffer\n"); in ibmasm_init_one()
89 result = ibmasm_heartbeat_init(sp); in ibmasm_init_one()
91 dev_err(sp->dev, "Failed to allocate heartbeat command\n"); in ibmasm_init_one()
95 sp->irq = pdev->irq; in ibmasm_init_one()
96 sp->base_address = pci_ioremap_bar(pdev, 0); in ibmasm_init_one()
97 if (!sp->base_address) { in ibmasm_init_one()
98 dev_err(sp->dev, "Failed to ioremap pci memory\n"); in ibmasm_init_one()
103 result = request_irq(sp->irq, ibmasm_interrupt_handler, IRQF_SHARED, sp->devname, (void*)sp); in ibmasm_init_one()
105 dev_err(sp->dev, "Failed to register interrupt handler\n"); in ibmasm_init_one()
109 enable_sp_interrupts(sp->base_address); in ibmasm_init_one()
111 result = ibmasm_init_remote_input_dev(sp); in ibmasm_init_one()
113 dev_err(sp->dev, "Failed to initialize remote queue\n"); in ibmasm_init_one()
117 result = ibmasm_send_driver_vpd(sp); in ibmasm_init_one()
119 dev_err(sp->dev, "Failed to send driver VPD to service processor\n"); in ibmasm_init_one()
122 result = ibmasm_send_os_state(sp, SYSTEM_STATE_OS_UP); in ibmasm_init_one()
124 dev_err(sp->dev, "Failed to send OS state to service processor\n"); in ibmasm_init_one()
127 ibmasmfs_add_sp(sp); in ibmasm_init_one()
129 ibmasm_register_uart(sp); in ibmasm_init_one()
134 ibmasm_free_remote_input_dev(sp); in ibmasm_init_one()
136 disable_sp_interrupts(sp->base_address); in ibmasm_init_one()
137 free_irq(sp->irq, (void *)sp); in ibmasm_init_one()
139 iounmap(sp->base_address); in ibmasm_init_one()
141 ibmasm_heartbeat_exit(sp); in ibmasm_init_one()
143 ibmasm_event_buffer_exit(sp); in ibmasm_init_one()
145 kfree(sp); in ibmasm_init_one()
156 struct service_processor *sp = pci_get_drvdata(pdev); in ibmasm_remove_one() local
159 ibmasm_unregister_uart(sp); in ibmasm_remove_one()
161 if (ibmasm_send_os_state(sp, SYSTEM_STATE_OS_DOWN)) in ibmasm_remove_one()
164 ibmasm_heartbeat_exit(sp); in ibmasm_remove_one()
166 disable_sp_interrupts(sp->base_address); in ibmasm_remove_one()
168 free_irq(sp->irq, (void *)sp); in ibmasm_remove_one()
170 ibmasm_free_remote_input_dev(sp); in ibmasm_remove_one()
171 iounmap(sp->base_address); in ibmasm_remove_one()
172 ibmasm_event_buffer_exit(sp); in ibmasm_remove_one()
173 kfree(sp); in ibmasm_remove_one()