Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: dvb-frontends/dvb-pll: Remove usage of the deprecated ida_simple_xx() API

ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().

Note that the upper limit of ida_simple_get() is exclusive, but the one of
ida_alloc_max() is inclusive. So a -1 has been added when needed.

Link: https://lore.kernel.org/linux-media/920639b9e05775eea56ecb9cd5ed38ad292a96a8.1705008803.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Christophe JAILLET and committed by
Mauro Carvalho Chehab
2350d4d4 b1d47b27

+3 -3
+3 -3
drivers/media/dvb-frontends/dvb-pll.c
··· 796 796 b1[0] = 0; 797 797 msg.buf = b1; 798 798 799 - nr = ida_simple_get(&pll_ida, 0, DVB_PLL_MAX, GFP_KERNEL); 799 + nr = ida_alloc_max(&pll_ida, DVB_PLL_MAX - 1, GFP_KERNEL); 800 800 if (nr < 0) { 801 801 kfree(b1); 802 802 return NULL; ··· 862 862 return fe; 863 863 out: 864 864 kfree(b1); 865 - ida_simple_remove(&pll_ida, nr); 865 + ida_free(&pll_ida, nr); 866 866 867 867 return NULL; 868 868 } ··· 905 905 struct dvb_frontend *fe = i2c_get_clientdata(client); 906 906 struct dvb_pll_priv *priv = fe->tuner_priv; 907 907 908 - ida_simple_remove(&pll_ida, priv->nr); 908 + ida_free(&pll_ida, priv->nr); 909 909 dvb_pll_release(fe); 910 910 } 911 911