| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * PWM device driver for ST SoCs |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Author: Ajit Pal Singh <ajitpal.singh@st.com> |
|---|
| 7 | 8 | * Lee Jones <lee.jones@linaro.org> |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 10 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 11 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 12 | | - * (at your option) any later version. |
|---|
| 13 | 9 | */ |
|---|
| 14 | 10 | |
|---|
| 15 | 11 | #include <linux/clk.h> |
|---|
| .. | .. |
|---|
| 375 | 371 | effective_ticks = clk_get_rate(pc->cpt_clk); |
|---|
| 376 | 372 | |
|---|
| 377 | 373 | result->period = (high + low) * NSEC_PER_SEC; |
|---|
| 378 | | - result->period = do_div(result->period, effective_ticks); |
|---|
| 374 | + result->period /= effective_ticks; |
|---|
| 379 | 375 | |
|---|
| 380 | 376 | result->duty_cycle = high * NSEC_PER_SEC; |
|---|
| 381 | | - result->duty_cycle = do_div(result->duty_cycle, |
|---|
| 382 | | - effective_ticks); |
|---|
| 377 | + result->duty_cycle /= effective_ticks; |
|---|
| 383 | 378 | |
|---|
| 384 | 379 | break; |
|---|
| 385 | 380 | |
|---|
| .. | .. |
|---|
| 569 | 564 | return PTR_ERR(pc->regmap); |
|---|
| 570 | 565 | |
|---|
| 571 | 566 | irq = platform_get_irq(pdev, 0); |
|---|
| 572 | | - if (irq < 0) { |
|---|
| 573 | | - dev_err(&pdev->dev, "Failed to obtain IRQ\n"); |
|---|
| 567 | + if (irq < 0) |
|---|
| 574 | 568 | return irq; |
|---|
| 575 | | - } |
|---|
| 576 | 569 | |
|---|
| 577 | 570 | ret = devm_request_irq(&pdev->dev, irq, sti_pwm_interrupt, 0, |
|---|
| 578 | 571 | pdev->name, pc); |
|---|