From: Dan Williams Date: Sat, 3 Jun 2023 06:13:59 +0000 (-0700) Subject: dax: Use device_unregister() in unregister_dax_mapping() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=82b4ceeccb89cfd0b03706f1b15e31a7db6a027d;p=linux.git dax: Use device_unregister() in unregister_dax_mapping() Replace an open-coded device_unregister() sequence with the helper. Signed-off-by: Dan Williams Link: https://lore.kernel.org/r/168577283989.1672036.7777592498865470652.stgit@dwillia2-xfh.jf.intel.com Reviewed-by: Dave Jiang Reviewed-by: Fan Ni Reviewed-by: Ira Weiny Signed-off-by: Vishal Verma --- diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c index aee695f86b445..c99ea08aafc32 100644 --- a/drivers/dax/bus.c +++ b/drivers/dax/bus.c @@ -657,8 +657,7 @@ static void unregister_dax_mapping(void *data) dev_dax->ranges[mapping->range_id].mapping = NULL; mapping->range_id = -1; - device_del(dev); - put_device(dev); + device_unregister(dev); } static struct dev_dax_range *get_dax_range(struct device *dev)