| .. | .. |
|---|
| 1 | | -/* |
|---|
| 2 | | - * Copyright (C) 2009-2010, Lars-Peter Clausen <lars@metafoo.de> |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 5 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 6 | | - * published by the Free Software Foundation. |
|---|
| 7 | | - * |
|---|
| 8 | | - * You should have received a copy of the GNU General Public License along |
|---|
| 9 | | - * with this program; if not, write to the Free Software Foundation, Inc., |
|---|
| 10 | | - * 675 Mass Ave, Cambridge, MA 02139, USA. |
|---|
| 11 | | - * |
|---|
| 12 | | - */ |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
|---|
| 2 | +// |
|---|
| 3 | +// JZ4740 CODEC driver |
|---|
| 4 | +// |
|---|
| 5 | +// Copyright (C) 2009-2010, Lars-Peter Clausen <lars@metafoo.de> |
|---|
| 13 | 6 | |
|---|
| 14 | 7 | #include <linux/kernel.h> |
|---|
| 15 | 8 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 325 | 318 | { |
|---|
| 326 | 319 | int ret; |
|---|
| 327 | 320 | struct jz4740_codec *jz4740_codec; |
|---|
| 328 | | - struct resource *mem; |
|---|
| 329 | 321 | void __iomem *base; |
|---|
| 330 | 322 | |
|---|
| 331 | 323 | jz4740_codec = devm_kzalloc(&pdev->dev, sizeof(*jz4740_codec), |
|---|
| .. | .. |
|---|
| 333 | 325 | if (!jz4740_codec) |
|---|
| 334 | 326 | return -ENOMEM; |
|---|
| 335 | 327 | |
|---|
| 336 | | - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
|---|
| 337 | | - base = devm_ioremap_resource(&pdev->dev, mem); |
|---|
| 328 | + base = devm_platform_ioremap_resource(pdev, 0); |
|---|
| 338 | 329 | if (IS_ERR(base)) |
|---|
| 339 | 330 | return PTR_ERR(base); |
|---|
| 340 | 331 | |
|---|
| .. | .. |
|---|
| 353 | 344 | return ret; |
|---|
| 354 | 345 | } |
|---|
| 355 | 346 | |
|---|
| 347 | +static const struct of_device_id jz4740_codec_of_matches[] = { |
|---|
| 348 | + { .compatible = "ingenic,jz4740-codec", }, |
|---|
| 349 | + { } |
|---|
| 350 | +}; |
|---|
| 351 | +MODULE_DEVICE_TABLE(of, jz4740_codec_of_matches); |
|---|
| 352 | + |
|---|
| 356 | 353 | static struct platform_driver jz4740_codec_driver = { |
|---|
| 357 | 354 | .probe = jz4740_codec_probe, |
|---|
| 358 | 355 | .driver = { |
|---|
| 359 | 356 | .name = "jz4740-codec", |
|---|
| 357 | + .of_match_table = jz4740_codec_of_matches, |
|---|
| 360 | 358 | }, |
|---|
| 361 | 359 | }; |
|---|
| 362 | 360 | |
|---|