From mboxrd@z Thu Jan 1 00:00:00 1970 From: eric.auger@linaro.org (Eric Auger) Date: Fri, 23 Oct 2015 16:15:06 +0200 Subject: [PATCH v3 2/7] vfio: platform: add capability to register a reset function In-Reply-To: <5723752.hDK15zeNcm@wuerfel> References: <1445603835-14506-1-git-send-email-eric.auger@linaro.org> <1445603835-14506-3-git-send-email-eric.auger@linaro.org> <5723752.hDK15zeNcm@wuerfel> Message-ID: <562A40EA.40706@linaro.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 10/23/2015 03:07 PM, Arnd Bergmann wrote: > On Friday 23 October 2015 14:37:10 Eric Auger wrote: >> + >> +void vfio_platform_unregister_reset(const char *compat) >> +{ >> + struct vfio_platform_reset_node *iter, *temp; >> + >> + mutex_lock(&driver_lock); >> + list_for_each_entry_safe(iter, temp, &reset_list, link) { >> + if (!strcmp(iter->compat, compat)) { >> + list_del(&iter->link); >> + break; >> + } >> + } >> + >> + mutex_unlock(&driver_lock); >> +} >> +EXPORT_SYMBOL_GPL(vfio_platform_unregister_reset); >> > > This is slightly unsafe in case you ever get two drivers that register > with the same compat string. If we care about that, we could pass > and compare both the string and the function pointer, or the > vfio_platform_reset_node. OK Thanks Eric > > Arnd >