mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
hwrng: n2 - Use device_get_match_data()
Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
4dc44aec28
commit
30bf5bd05e
1 changed files with 3 additions and 7 deletions
|
@ -14,7 +14,8 @@
|
||||||
#include <linux/hw_random.h>
|
#include <linux/hw_random.h>
|
||||||
|
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
#include <linux/of_device.h>
|
#include <linux/platform_device.h>
|
||||||
|
#include <linux/property.h>
|
||||||
|
|
||||||
#include <asm/hypervisor.h>
|
#include <asm/hypervisor.h>
|
||||||
|
|
||||||
|
@ -695,20 +696,15 @@ static void n2rng_driver_version(void)
|
||||||
static const struct of_device_id n2rng_match[];
|
static const struct of_device_id n2rng_match[];
|
||||||
static int n2rng_probe(struct platform_device *op)
|
static int n2rng_probe(struct platform_device *op)
|
||||||
{
|
{
|
||||||
const struct of_device_id *match;
|
|
||||||
int err = -ENOMEM;
|
int err = -ENOMEM;
|
||||||
struct n2rng *np;
|
struct n2rng *np;
|
||||||
|
|
||||||
match = of_match_device(n2rng_match, &op->dev);
|
|
||||||
if (!match)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
n2rng_driver_version();
|
n2rng_driver_version();
|
||||||
np = devm_kzalloc(&op->dev, sizeof(*np), GFP_KERNEL);
|
np = devm_kzalloc(&op->dev, sizeof(*np), GFP_KERNEL);
|
||||||
if (!np)
|
if (!np)
|
||||||
goto out;
|
goto out;
|
||||||
np->op = op;
|
np->op = op;
|
||||||
np->data = (struct n2rng_template *)match->data;
|
np->data = (struct n2rng_template *)device_get_match_data(&op->dev);
|
||||||
|
|
||||||
INIT_DELAYED_WORK(&np->work, n2rng_work);
|
INIT_DELAYED_WORK(&np->work, n2rng_work);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue