Commit f29ca8f7 authored by Brian Masney's avatar Brian Masney Committed by Herbert Xu

crypto: qcom-rng - rename *_of_data to *_match_data

The qcom-rng driver supports both ACPI and device tree based systems.
Let's rename all instances of *of_data to *match_data so that it's
not implied that this driver only supports device tree-based systems.
Signed-off-by: default avatarBrian Masney <bmasney@redhat.com>
Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 3e87031a
...@@ -36,14 +36,14 @@ struct qcom_rng { ...@@ -36,14 +36,14 @@ struct qcom_rng {
void __iomem *base; void __iomem *base;
struct clk *clk; struct clk *clk;
struct hwrng hwrng; struct hwrng hwrng;
struct qcom_rng_of_data *of_data; struct qcom_rng_match_data *match_data;
}; };
struct qcom_rng_ctx { struct qcom_rng_ctx {
struct qcom_rng *rng; struct qcom_rng *rng;
}; };
struct qcom_rng_of_data { struct qcom_rng_match_data {
bool skip_init; bool skip_init;
bool hwrng_support; bool hwrng_support;
}; };
...@@ -155,7 +155,7 @@ static int qcom_rng_init(struct crypto_tfm *tfm) ...@@ -155,7 +155,7 @@ static int qcom_rng_init(struct crypto_tfm *tfm)
ctx->rng = qcom_rng_dev; ctx->rng = qcom_rng_dev;
if (!ctx->rng->of_data->skip_init) if (!ctx->rng->match_data->skip_init)
return qcom_rng_enable(ctx->rng); return qcom_rng_enable(ctx->rng);
return 0; return 0;
...@@ -196,7 +196,7 @@ static int qcom_rng_probe(struct platform_device *pdev) ...@@ -196,7 +196,7 @@ static int qcom_rng_probe(struct platform_device *pdev)
if (IS_ERR(rng->clk)) if (IS_ERR(rng->clk))
return PTR_ERR(rng->clk); return PTR_ERR(rng->clk);
rng->of_data = (struct qcom_rng_of_data *)device_get_match_data(&pdev->dev); rng->match_data = (struct qcom_rng_match_data *)device_get_match_data(&pdev->dev);
qcom_rng_dev = rng; qcom_rng_dev = rng;
ret = crypto_register_rng(&qcom_rng_alg); ret = crypto_register_rng(&qcom_rng_alg);
...@@ -206,7 +206,7 @@ static int qcom_rng_probe(struct platform_device *pdev) ...@@ -206,7 +206,7 @@ static int qcom_rng_probe(struct platform_device *pdev)
return ret; return ret;
} }
if (rng->of_data->hwrng_support) { if (rng->match_data->hwrng_support) {
rng->hwrng.name = "qcom_hwrng"; rng->hwrng.name = "qcom_hwrng";
rng->hwrng.read = qcom_hwrng_read; rng->hwrng.read = qcom_hwrng_read;
rng->hwrng.quality = QCOM_TRNG_QUALITY; rng->hwrng.quality = QCOM_TRNG_QUALITY;
...@@ -231,31 +231,31 @@ static void qcom_rng_remove(struct platform_device *pdev) ...@@ -231,31 +231,31 @@ static void qcom_rng_remove(struct platform_device *pdev)
qcom_rng_dev = NULL; qcom_rng_dev = NULL;
} }
static struct qcom_rng_of_data qcom_prng_of_data = { static struct qcom_rng_match_data qcom_prng_match_data = {
.skip_init = false, .skip_init = false,
.hwrng_support = false, .hwrng_support = false,
}; };
static struct qcom_rng_of_data qcom_prng_ee_of_data = { static struct qcom_rng_match_data qcom_prng_ee_match_data = {
.skip_init = true, .skip_init = true,
.hwrng_support = false, .hwrng_support = false,
}; };
static struct qcom_rng_of_data qcom_trng_of_data = { static struct qcom_rng_match_data qcom_trng_match_data = {
.skip_init = true, .skip_init = true,
.hwrng_support = true, .hwrng_support = true,
}; };
static const struct acpi_device_id __maybe_unused qcom_rng_acpi_match[] = { static const struct acpi_device_id __maybe_unused qcom_rng_acpi_match[] = {
{ .id = "QCOM8160", .driver_data = (kernel_ulong_t)&qcom_prng_ee_of_data }, { .id = "QCOM8160", .driver_data = (kernel_ulong_t)&qcom_prng_ee_match_data },
{} {}
}; };
MODULE_DEVICE_TABLE(acpi, qcom_rng_acpi_match); MODULE_DEVICE_TABLE(acpi, qcom_rng_acpi_match);
static const struct of_device_id __maybe_unused qcom_rng_of_match[] = { static const struct of_device_id __maybe_unused qcom_rng_of_match[] = {
{ .compatible = "qcom,prng", .data = &qcom_prng_of_data }, { .compatible = "qcom,prng", .data = &qcom_prng_match_data },
{ .compatible = "qcom,prng-ee", .data = &qcom_prng_ee_of_data }, { .compatible = "qcom,prng-ee", .data = &qcom_prng_ee_match_data },
{ .compatible = "qcom,trng", .data = &qcom_trng_of_data }, { .compatible = "qcom,trng", .data = &qcom_trng_match_data },
{} {}
}; };
MODULE_DEVICE_TABLE(of, qcom_rng_of_match); MODULE_DEVICE_TABLE(of, qcom_rng_of_match);
......
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