pxa27x_keypad.c (6f84981772535e670e4e2df051a672af229b6694) | pxa27x_keypad.c (198a2ccaaab8fca64f7b367969038badae96f3bd) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * linux/drivers/input/keyboard/pxa27x_keypad.c 4 * 5 * Driver for the pxa27x matrix keyboard controller. 6 * 7 * Created: Feb 22, 2007 8 * Author: Rodolfo Giometti <giometti@linux.it> --- 703 unchanged lines hidden (view full) --- 712 713static int pxa27x_keypad_probe(struct platform_device *pdev) 714{ 715 const struct pxa27x_keypad_platform_data *pdata = 716 dev_get_platdata(&pdev->dev); 717 struct device_node *np = pdev->dev.of_node; 718 struct pxa27x_keypad *keypad; 719 struct input_dev *input_dev; | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * linux/drivers/input/keyboard/pxa27x_keypad.c 4 * 5 * Driver for the pxa27x matrix keyboard controller. 6 * 7 * Created: Feb 22, 2007 8 * Author: Rodolfo Giometti <giometti@linux.it> --- 703 unchanged lines hidden (view full) --- 712 713static int pxa27x_keypad_probe(struct platform_device *pdev) 714{ 715 const struct pxa27x_keypad_platform_data *pdata = 716 dev_get_platdata(&pdev->dev); 717 struct device_node *np = pdev->dev.of_node; 718 struct pxa27x_keypad *keypad; 719 struct input_dev *input_dev; |
720 struct resource *res; | |
721 int irq, error; 722 723 /* Driver need build keycode from device tree or pdata */ 724 if (!np && !pdata) 725 return -EINVAL; 726 727 irq = platform_get_irq(pdev, 0); 728 if (irq < 0) 729 return -ENXIO; 730 | 720 int irq, error; 721 722 /* Driver need build keycode from device tree or pdata */ 723 if (!np && !pdata) 724 return -EINVAL; 725 726 irq = platform_get_irq(pdev, 0); 727 if (irq < 0) 728 return -ENXIO; 729 |
731 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 732 if (res == NULL) { 733 dev_err(&pdev->dev, "failed to get I/O memory\n"); 734 return -ENXIO; 735 } 736 | |
737 keypad = devm_kzalloc(&pdev->dev, sizeof(*keypad), 738 GFP_KERNEL); 739 if (!keypad) 740 return -ENOMEM; 741 742 input_dev = devm_input_allocate_device(&pdev->dev); 743 if (!input_dev) 744 return -ENOMEM; 745 746 keypad->pdata = pdata; 747 keypad->input_dev = input_dev; 748 keypad->irq = irq; 749 | 730 keypad = devm_kzalloc(&pdev->dev, sizeof(*keypad), 731 GFP_KERNEL); 732 if (!keypad) 733 return -ENOMEM; 734 735 input_dev = devm_input_allocate_device(&pdev->dev); 736 if (!input_dev) 737 return -ENOMEM; 738 739 keypad->pdata = pdata; 740 keypad->input_dev = input_dev; 741 keypad->irq = irq; 742 |
750 keypad->mmio_base = devm_ioremap_resource(&pdev->dev, res); | 743 keypad->mmio_base = devm_platform_ioremap_resource(pdev, 0); |
751 if (IS_ERR(keypad->mmio_base)) 752 return PTR_ERR(keypad->mmio_base); 753 754 keypad->clk = devm_clk_get(&pdev->dev, NULL); 755 if (IS_ERR(keypad->clk)) { 756 dev_err(&pdev->dev, "failed to get keypad clock\n"); 757 return PTR_ERR(keypad->clk); 758 } --- 81 unchanged lines hidden --- | 744 if (IS_ERR(keypad->mmio_base)) 745 return PTR_ERR(keypad->mmio_base); 746 747 keypad->clk = devm_clk_get(&pdev->dev, NULL); 748 if (IS_ERR(keypad->clk)) { 749 dev_err(&pdev->dev, "failed to get keypad clock\n"); 750 return PTR_ERR(keypad->clk); 751 } --- 81 unchanged lines hidden --- |