From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6BA161459FA; Thu, 13 Jun 2024 12:19:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718281198; cv=none; b=DDVTpGaYnDj8PRcpYTv0gBIUnFDKoJThtns+KT2Z5JIAa7NGe3NpGB1hT2ltCLqZfBY/S+5jdPZtS1og8bJKTq9gt0Sd+di0jBUwAfeFTK7KAROWZOcBfuoAIPopyJdHQz/MyQIucUMwOXCUDiwUVijXkQIwwl7ey4O19rYO8d4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718281198; c=relaxed/simple; bh=XIAIQTe/juTYP63FACsg5TT9kJxHZHuZlbAPzEx6Sdg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=knVP8LICOHusWOLdbvQs9eh4qtoFTM6gigS5TsFKINZrxSusFQ9bLyN89kbAXgKWmqcVxDYm8aYO8UKpW5FZsSIzDjSk56l/q5oDIOrzkMtAUBJfO4bAVrUiP+llWKmsTtm32tZV/RpdJDQlJdn0rOLOtvGXeaHDNgnWI80rC34= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ul4jz+is; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Ul4jz+is" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7727C2BBFC; Thu, 13 Jun 2024 12:19:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718281198; bh=XIAIQTe/juTYP63FACsg5TT9kJxHZHuZlbAPzEx6Sdg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ul4jz+isRihcILbBdAavMgm+7GI+8AlcxYmoazK3dczrNHqyJwBZIh17GpV1Zx/bh 9/IL100RYj8I7Whe3clR4BRwGnsO1kFVN1/9yN/jlKZkhbE1ukOQksDnH+zWD9zUOL 6Y2DbyKa6n0Toh6tut8MFMqrXZLd3Y2J1xLud7Ek= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Christophe JAILLET , Sasha Levin Subject: [PATCH 5.10 174/317] ppdev: Remove usage of the deprecated ida_simple_xx() API Date: Thu, 13 Jun 2024 13:33:12 +0200 Message-ID: <20240613113254.290148834@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240613113247.525431100@linuxfoundation.org> References: <20240613113247.525431100@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christophe JAILLET [ Upstream commit d8407f71ebeaeb6f50bd89791837873e44609708 ] ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). This is less verbose. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/ba9da12fdd5cdb2c28180b7160af5042447d803f.1702962092.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman Stable-dep-of: fbf740aeb86a ("ppdev: Add an error check in register_device") Signed-off-by: Sasha Levin --- drivers/char/ppdev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c index 38b46c7d17371..f6024d97fe70b 100644 --- a/drivers/char/ppdev.c +++ b/drivers/char/ppdev.c @@ -299,7 +299,7 @@ static int register_device(int minor, struct pp_struct *pp) goto err; } - index = ida_simple_get(&ida_index, 0, 0, GFP_KERNEL); + index = ida_alloc(&ida_index, GFP_KERNEL); memset(&ppdev_cb, 0, sizeof(ppdev_cb)); ppdev_cb.irq_func = pp_irq; ppdev_cb.flags = (pp->flags & PP_EXCL) ? PARPORT_FLAG_EXCL : 0; @@ -310,7 +310,7 @@ static int register_device(int minor, struct pp_struct *pp) if (!pdev) { pr_warn("%s: failed to register device!\n", name); rc = -ENXIO; - ida_simple_remove(&ida_index, index); + ida_free(&ida_index, index); goto err; } @@ -750,7 +750,7 @@ static int pp_release(struct inode *inode, struct file *file) if (pp->pdev) { parport_unregister_device(pp->pdev); - ida_simple_remove(&ida_index, pp->index); + ida_free(&ida_index, pp->index); pp->pdev = NULL; pr_debug(CHRDEV "%x: unregistered pardevice\n", minor); } -- 2.43.0