soc: ti: Use of_property_read_bool() for boolean properties
authorRob Herring <robh@kernel.org>
Fri, 10 Mar 2023 14:47:25 +0000 (08:47 -0600)
committerNishanth Menon <nm@ti.com>
Sat, 11 Mar 2023 11:57:07 +0000 (05:57 -0600)
It is preferred to use typed property access functions (i.e.
of_property_read_<type> functions) rather than low-level
of_get_property/of_find_property functions for reading properties.
Convert reading boolean properties to of_property_read_bool().

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Nishanth Menon <nm@ti.com>
Link: https://lore.kernel.org/r/20230310144726.1545453-1-robh@kernel.org
drivers/soc/ti/knav_dma.c
drivers/soc/ti/knav_qmss_acc.c
drivers/soc/ti/knav_qmss_queue.c
drivers/soc/ti/wkup_m3_ipc.c

index 84afebd355befc560496837f4f06559ef5316b1e..0fbc37cd5123106c475eb605d489dff6e743e72f 100644 (file)
@@ -666,8 +666,8 @@ static int dma_init(struct device_node *cloud, struct device_node *dma_node)
        dma->rx_priority = DMA_PRIO_DEFAULT;
        dma->tx_priority = DMA_PRIO_DEFAULT;
 
-       dma->enable_all = (of_get_property(node, "ti,enable-all", NULL) != NULL);
-       dma->loopback   = (of_get_property(node, "ti,loop-back",  NULL) != NULL);
+       dma->enable_all = of_property_read_bool(node, "ti,enable-all");
+       dma->loopback   = of_property_read_bool(node, "ti,loop-back");
 
        ret = of_property_read_u32(node, "ti,rx-retry-timeout", &timeout);
        if (ret < 0) {
index fde66e28e046a4aa97897ecf3ee72c09703aaf56..3d388646ed43c359f3d2dd0f8ef538f0818a7bd2 100644 (file)
@@ -521,7 +521,7 @@ int knav_init_acc_range(struct knav_device *kdev,
 
        info->pdsp = pdsp;
        channels = range->num_queues;
-       if (of_get_property(node, "multi-queue", NULL)) {
+       if (of_property_read_bool(node, "multi-queue")) {
                range->flags |= RANGE_MULTI_QUEUE;
                channels = 1;
                if (range->queue_base & (32 - 1)) {
index 48de98560093751e25ff53715522151ddd92d422..0f252c2549ba3148f478412a2a0a3d740b64faf2 100644 (file)
@@ -1264,7 +1264,7 @@ static int knav_setup_queue_range(struct knav_device *kdev,
        if (range->num_irqs)
                range->flags |= RANGE_HAS_IRQ;
 
-       if (of_get_property(node, "qalloc-by-id", NULL))
+       if (of_property_read_bool(node, "qalloc-by-id"))
                range->flags |= RANGE_RESERVED;
 
        if (of_property_present(node, "accumulator")) {
index 343c58ed58961044e03d304eeb5596a4a40bac8d..6970478b40f3184d2f7450e85487b2b8c78b75c4 100644 (file)
@@ -681,7 +681,7 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)
                        dev_warn(dev, "Invalid VTT GPIO(%d) pin\n", temp);
        }
 
-       if (of_find_property(np, "ti,set-io-isolation", NULL))
+       if (of_property_read_bool(np, "ti,set-io-isolation"))
                wkup_m3_set_io_isolation(m3_ipc);
 
        ret = of_property_read_string(np, "firmware-name",