16280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna/* 26280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * ntfy.h 36280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * 46280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * DSP-BIOS Bridge driver support functions for TI OMAP processors. 56280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * 66280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * Manage lists of notification events. 76280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * 86280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * Copyright (C) 2005-2006 Texas Instruments, Inc. 96280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * 106280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * This package is free software; you can redistribute it and/or modify 116280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * it under the terms of the GNU General Public License version 2 as 126280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * published by the Free Software Foundation. 136280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * 146280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 156280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 166280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 176280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna */ 186280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 196280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna#ifndef NTFY_ 206280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna#define NTFY_ 216280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 226280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna#include <dspbridge/host_os.h> 236280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna#include <dspbridge/dbdefs.h> 246280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna#include <dspbridge/sync.h> 256280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 266280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna/** 276280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * ntfy_object - head structure to nofify dspbridge events 286280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @head: List of notify objects 296280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @ntfy_lock: lock for list access. 306280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * 316280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna */ 326280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Lunastruct ntfy_object { 336280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna struct raw_notifier_head head;/* List of notifier objects */ 346280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna spinlock_t ntfy_lock; /* For critical sections */ 356280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna}; 366280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 376280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna/** 386280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * ntfy_event - structure store specify event to be notified 396280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @noti_block: List of notify objects 406280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @event: event that it respond 416280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @type: event type (only DSP_SIGNALEVENT supported) 426280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @sync_obj: sync_event used to set the event 436280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * 446280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna */ 456280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Lunastruct ntfy_event { 466280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna struct notifier_block noti_block; 476280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna u32 event; /* Events to be notified about */ 486280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna u32 type; /* Type of notification to be sent */ 496280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna struct sync_object sync_obj; 506280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna}; 516280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 526280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 536280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna/** 546280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * dsp_notifier_event() - callback function to nofity events 556280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @this: pointer to itself struct notifier_block 566280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @event: event to be notified. 576280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @data: Currently not used. 586280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * 596280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna */ 606280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Lunaint dsp_notifier_event(struct notifier_block *this, unsigned long event, 616280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna void *data); 626280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 636280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna/** 646280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * ntfy_init() - Set the initial state of the ntfy_object structure. 656280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @no: pointer to ntfy_object structure. 666280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * 676280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * This function sets the initial state of the ntfy_object in order it 686280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * can be used by the other ntfy functions. 696280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna */ 706280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 716280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Lunastatic inline void ntfy_init(struct ntfy_object *no) 726280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna{ 736280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna spin_lock_init(&no->ntfy_lock); 746280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna RAW_INIT_NOTIFIER_HEAD(&no->head); 756280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna} 766280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 776280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna/** 786280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * ntfy_delete() - delete list of nofy events registered. 796280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @ntfy_obj: Pointer to the ntfy object structure. 806280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * 816280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * This function is used to remove all the notify events registered. 826280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * unregister function is not needed in this function, to unregister 836280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * a ntfy_event please look at ntfy_register function. 846280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * 856280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna */ 866280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Lunastatic inline void ntfy_delete(struct ntfy_object *ntfy_obj) 876280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna{ 886280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna struct ntfy_event *ne; 896280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna struct notifier_block *nb; 906280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 916280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna spin_lock_bh(&ntfy_obj->ntfy_lock); 926280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna nb = ntfy_obj->head.head; 936280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna while (nb) { 946280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna ne = container_of(nb, struct ntfy_event, noti_block); 956280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna nb = nb->next; 966280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna kfree(ne); 976280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna } 986280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna spin_unlock_bh(&ntfy_obj->ntfy_lock); 996280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna} 1006280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 1016280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna/** 1026280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * ntfy_notify() - nofity all event register for an specific event. 1036280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @ntfy_obj: Pointer to the ntfy_object structure. 1046280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @event: event to be notified. 1056280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * 1066280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * This function traverses all the ntfy events registers and 1076280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * set the event with mach with @event. 1086280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna */ 1096280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Lunastatic inline void ntfy_notify(struct ntfy_object *ntfy_obj, u32 event) 1106280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna{ 1116280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna spin_lock_bh(&ntfy_obj->ntfy_lock); 1126280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna raw_notifier_call_chain(&ntfy_obj->head, event, NULL); 1136280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna spin_unlock_bh(&ntfy_obj->ntfy_lock); 1146280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna} 1156280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 1166280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 1176280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 1186280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna/** 1196280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * ntfy_init() - Create and initialize a ntfy_event structure. 1206280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @event: event that the ntfy event will respond 1216280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @type event type (only DSP_SIGNALEVENT supported) 1226280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * 1236280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * This function create a ntfy_event element and sets the event it will 1246280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * respond the ntfy_event in order it can be used by the other ntfy functions. 1256280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * In case of success it will return a pointer to the ntfy_event struct 1266280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * created. Otherwise it will return NULL; 1276280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna */ 1286280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 1296280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Lunastatic inline struct ntfy_event *ntfy_event_create(u32 event, u32 type) 1306280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna{ 1316280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna struct ntfy_event *ne; 1326280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna ne = kmalloc(sizeof(struct ntfy_event), GFP_KERNEL); 1336280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna if (ne) { 1346280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna sync_init_event(&ne->sync_obj); 1356280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna ne->noti_block.notifier_call = dsp_notifier_event; 1366280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna ne->event = event; 1376280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna ne->type = type; 1386280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna } 1396280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna return ne; 1406280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna} 1416280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 1426280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna/** 1436280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * ntfy_register() - register new ntfy_event into a given ntfy_object 1446280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @ntfy_obj: Pointer to the ntfy_object structure. 1456280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @noti: Pointer to the handle to be returned to the user space. 1466280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @event event that the ntfy event will respond 1476280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @type event type (only DSP_SIGNALEVENT supported) 1486280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * 1496280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * This function register a new ntfy_event into the ntfy_object list, 1506280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * which will respond to the @event passed. 1516280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * This function will return 0 in case of error. 1526280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * -EFAULT in case of bad pointers and 1536280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * DSP_EMemory in case of no memory to create ntfy_event. 1546280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna */ 1556280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Lunastatic inline int ntfy_register(struct ntfy_object *ntfy_obj, 1566280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna struct dsp_notification *noti, 1576280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna u32 event, u32 type) 1586280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna{ 1596280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna struct ntfy_event *ne; 1606280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna int status = 0; 1616280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 1626280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna if (!noti || !ntfy_obj) { 1636280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna status = -EFAULT; 1646280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna goto func_end; 1656280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna } 1666280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna if (!event) { 1676280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna status = -EINVAL; 1686280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna goto func_end; 1696280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna } 1706280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna ne = ntfy_event_create(event, type); 1716280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna if (!ne) { 1726280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna status = -ENOMEM; 1736280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna goto func_end; 1746280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna } 1756280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna noti->handle = &ne->sync_obj; 1766280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 1776280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna spin_lock_bh(&ntfy_obj->ntfy_lock); 1786280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna raw_notifier_chain_register(&ntfy_obj->head, &ne->noti_block); 1796280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna spin_unlock_bh(&ntfy_obj->ntfy_lock); 1806280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Lunafunc_end: 1816280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna return status; 1826280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna} 1836280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 1846280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna/** 1856280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * ntfy_unregister() - unregister a ntfy_event from a given ntfy_object 1866280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @ntfy_obj: Pointer to the ntfy_object structure. 1876280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @noti: Pointer to the event that will be removed. 1886280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * 1896280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * This function unregister a ntfy_event from the ntfy_object list, 1906280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * @noti contains the event which is wanted to be removed. 1916280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * This function will return 0 in case of error. 1926280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * -EFAULT in case of bad pointers and 1936280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna * DSP_EMemory in case of no memory to create ntfy_event. 1946280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna */ 1956280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Lunastatic inline int ntfy_unregister(struct ntfy_object *ntfy_obj, 1966280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna struct dsp_notification *noti) 1976280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna{ 1986280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna int status = 0; 1996280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna struct ntfy_event *ne; 2006280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 2016280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna if (!noti || !ntfy_obj) { 2026280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna status = -EFAULT; 2036280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna goto func_end; 2046280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna } 2056280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 2066280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna ne = container_of((struct sync_object *)noti, struct ntfy_event, 2076280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna sync_obj); 2086280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna spin_lock_bh(&ntfy_obj->ntfy_lock); 2096280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna raw_notifier_chain_unregister(&ntfy_obj->head, 2106280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna &ne->noti_block); 2116280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna kfree(ne); 2126280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna spin_unlock_bh(&ntfy_obj->ntfy_lock); 2136280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Lunafunc_end: 2146280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna return status; 2156280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna} 2166280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna 2176280238c13e16a105fe658e1b6e68380cbc9f055Omar Ramirez Luna#endif /* NTFY_ */ 218