mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
net: dsa: microchip: ksz8: Prepare ksz8863_smi for regmap register access validation
This patch prepares the ksz8863_smi part of ksz8 driver to utilize the regmap register access validation feature. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
bb4609d27f
commit
ae1ad12e9d
1 changed files with 11 additions and 0 deletions
|
@ -104,6 +104,7 @@ static const struct regmap_config ksz8863_regmap_config[] = {
|
|||
.cache_type = REGCACHE_NONE,
|
||||
.lock = ksz_regmap_lock,
|
||||
.unlock = ksz_regmap_unlock,
|
||||
.max_register = U8_MAX,
|
||||
},
|
||||
{
|
||||
.name = "#16",
|
||||
|
@ -113,6 +114,7 @@ static const struct regmap_config ksz8863_regmap_config[] = {
|
|||
.cache_type = REGCACHE_NONE,
|
||||
.lock = ksz_regmap_lock,
|
||||
.unlock = ksz_regmap_unlock,
|
||||
.max_register = U8_MAX,
|
||||
},
|
||||
{
|
||||
.name = "#32",
|
||||
|
@ -122,11 +124,14 @@ static const struct regmap_config ksz8863_regmap_config[] = {
|
|||
.cache_type = REGCACHE_NONE,
|
||||
.lock = ksz_regmap_lock,
|
||||
.unlock = ksz_regmap_unlock,
|
||||
.max_register = U8_MAX,
|
||||
}
|
||||
};
|
||||
|
||||
static int ksz8863_smi_probe(struct mdio_device *mdiodev)
|
||||
{
|
||||
struct device *ddev = &mdiodev->dev;
|
||||
const struct ksz_chip_data *chip;
|
||||
struct regmap_config rc;
|
||||
struct ksz_device *dev;
|
||||
int ret;
|
||||
|
@ -136,9 +141,15 @@ static int ksz8863_smi_probe(struct mdio_device *mdiodev)
|
|||
if (!dev)
|
||||
return -ENOMEM;
|
||||
|
||||
chip = device_get_match_data(ddev);
|
||||
if (!chip)
|
||||
return -EINVAL;
|
||||
|
||||
for (i = 0; i < __KSZ_NUM_REGMAPS; i++) {
|
||||
rc = ksz8863_regmap_config[i];
|
||||
rc.lock_arg = &dev->regmap_mutex;
|
||||
rc.wr_table = chip->wr_table;
|
||||
rc.rd_table = chip->rd_table;
|
||||
dev->regmap[i] = devm_regmap_init(&mdiodev->dev,
|
||||
®map_smi[i], dev,
|
||||
&rc);
|
||||
|
|
Loading…
Add table
Reference in a new issue