mirror of https://github.com/torvalds/linux.git
crypto: cesa - Simplify with of_device_get_match_data()
Driver's probe function matches against driver's of_device_id table, where each entry has non-NULL match data, so of_match_node() can be simplified with of_device_get_match_data(). Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
4ae946a45d
commit
054c7f7ad3
|
|
@ -420,7 +420,6 @@ static int mv_cesa_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
const struct mv_cesa_caps *caps = &orion_caps;
|
const struct mv_cesa_caps *caps = &orion_caps;
|
||||||
const struct mbus_dram_target_info *dram;
|
const struct mbus_dram_target_info *dram;
|
||||||
const struct of_device_id *match;
|
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct mv_cesa_dev *cesa;
|
struct mv_cesa_dev *cesa;
|
||||||
struct mv_cesa_engine *engines;
|
struct mv_cesa_engine *engines;
|
||||||
|
|
@ -433,11 +432,9 @@ static int mv_cesa_probe(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dev->of_node) {
|
if (dev->of_node) {
|
||||||
match = of_match_node(mv_cesa_of_match_table, dev->of_node);
|
caps = of_device_get_match_data(dev);
|
||||||
if (!match || !match->data)
|
if (!caps)
|
||||||
return -ENOTSUPP;
|
return -ENOTSUPP;
|
||||||
|
|
||||||
caps = match->data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cesa = devm_kzalloc(dev, sizeof(*cesa), GFP_KERNEL);
|
cesa = devm_kzalloc(dev, sizeof(*cesa), GFP_KERNEL);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue