Revert "firmware: ti_sci: Use devm_bitmap_zalloc when applicable"

Bugzilla: https://bugzilla.redhat.com/2234390

Upstream Status: RHEL only

This commit is part of a series which reverts
https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/2687
whose purpose was to address https://bugzilla.redhat.com/2183343

This reverts centos-stream-9 commit a897874f3b

commit a897874f3b
Author: Sebastian Ott <sebott@redhat.com>
Date:   Tue Jun 20 12:51:17 2023 -0400

    firmware: ti_sci: Use devm_bitmap_zalloc when applicable

    Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2183343

    'xfer_alloc_table' is a bitmap. So use 'devm_bitmap_zalloc()' to simplify
    code and improve the semantic of the code.

    While at it, remove a redundant 'bitmap_zero()' call.

    Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    Signed-off-by: Nishanth Menon <nm@ti.com>
    Reviewed-by: Nishanth Menon <nm@ti.com>
    Link: https://lore.kernel.org/r/43ab1a7dd073d0d037d5d4bbbd5f8335de605826.1667457664.git.christophe.jaillet@wanadoo.fr
    (cherry picked from commit 26507b033e84be6f821dc1693d667b5c809a7679)
    Signed-off-by: Sebastian Ott <sebott@redhat.com>

Signed-off-by: Lenny Szubowicz <lszubowi@redhat.com>
This commit is contained in:
Lenny Szubowicz 2023-08-31 21:46:57 -04:00
parent ce12d7e6a6
commit 39440a94d8
1 changed files with 5 additions and 3 deletions

View File

@ -3398,11 +3398,13 @@ static int ti_sci_probe(struct platform_device *pdev)
if (!minfo->xfer_block)
return -ENOMEM;
minfo->xfer_alloc_table = devm_bitmap_zalloc(dev,
desc->max_msgs,
GFP_KERNEL);
minfo->xfer_alloc_table = devm_kcalloc(dev,
BITS_TO_LONGS(desc->max_msgs),
sizeof(unsigned long),
GFP_KERNEL);
if (!minfo->xfer_alloc_table)
return -ENOMEM;
bitmap_zero(minfo->xfer_alloc_table, desc->max_msgs);
/* Pre-initialize the buffer pointer to pre-allocated buffers */
for (i = 0, xfer = minfo->xfer_block; i < desc->max_msgs; i++, xfer++) {