Commit fa14c6cf authored by LEROY Christophe's avatar LEROY Christophe Committed by Herbert Xu

crypto: talitos - use of_property_read_u32()

Use of_property_read_u32() to simplify DT read
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 24b92ff2
...@@ -3158,7 +3158,6 @@ static int talitos_probe(struct platform_device *ofdev) ...@@ -3158,7 +3158,6 @@ static int talitos_probe(struct platform_device *ofdev)
struct device *dev = &ofdev->dev; struct device *dev = &ofdev->dev;
struct device_node *np = ofdev->dev.of_node; struct device_node *np = ofdev->dev.of_node;
struct talitos_private *priv; struct talitos_private *priv;
const unsigned int *prop;
int i, err; int i, err;
int stride; int stride;
...@@ -3182,21 +3181,11 @@ static int talitos_probe(struct platform_device *ofdev) ...@@ -3182,21 +3181,11 @@ static int talitos_probe(struct platform_device *ofdev)
} }
/* get SEC version capabilities from device tree */ /* get SEC version capabilities from device tree */
prop = of_get_property(np, "fsl,num-channels", NULL); of_property_read_u32(np, "fsl,num-channels", &priv->num_channels);
if (prop) of_property_read_u32(np, "fsl,channel-fifo-len", &priv->chfifo_len);
priv->num_channels = *prop; of_property_read_u32(np, "fsl,exec-units-mask", &priv->exec_units);
of_property_read_u32(np, "fsl,descriptor-types-mask",
prop = of_get_property(np, "fsl,channel-fifo-len", NULL); &priv->desc_types);
if (prop)
priv->chfifo_len = *prop;
prop = of_get_property(np, "fsl,exec-units-mask", NULL);
if (prop)
priv->exec_units = *prop;
prop = of_get_property(np, "fsl,descriptor-types-mask", NULL);
if (prop)
priv->desc_types = *prop;
if (!is_power_of_2(priv->num_channels) || !priv->chfifo_len || if (!is_power_of_2(priv->num_channels) || !priv->chfifo_len ||
!priv->exec_units || !priv->desc_types) { !priv->exec_units || !priv->desc_types) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment