Skip to content

Commit f7bc152

Browse files
Dragan Simicbroonie
authored andcommitted
spi: rockchip: Perform trivial code cleanups
Perform a few trivial code cleanups, to obey the reverse Christmas tree rule, to avoid unnecessary line wrapping by using the 100-column width better, to actually obey the 100-column width in one case, and to make the way a couple of wrapped function arguments are indented a bit more readable. No intended functional changes are introduced by these code cleanups. Reviewed-by: Heiko Stuebner <[email protected]> Signed-off-by: Dragan Simic <[email protected]> Link: https://patch.msgid.link/1b55380a0b9f0e8fe1a09611636b30e232b95d08.1727601608.git.dsimic@manjaro.org Signed-off-by: Mark Brown <[email protected]>
1 parent 8cf0b93 commit f7bc152

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

drivers/spi/spi-rockchip.c

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -742,22 +742,20 @@ static int rockchip_spi_setup(struct spi_device *spi)
742742

743743
static int rockchip_spi_probe(struct platform_device *pdev)
744744
{
745-
int ret;
746-
struct rockchip_spi *rs;
745+
struct device_node *np = pdev->dev.of_node;
747746
struct spi_controller *ctlr;
747+
struct rockchip_spi *rs;
748748
struct resource *mem;
749-
struct device_node *np = pdev->dev.of_node;
750749
u32 rsd_nsecs, num_cs;
751750
bool target_mode;
751+
int ret;
752752

753753
target_mode = of_property_read_bool(np, "spi-slave");
754754

755755
if (target_mode)
756-
ctlr = spi_alloc_target(&pdev->dev,
757-
sizeof(struct rockchip_spi));
756+
ctlr = spi_alloc_target(&pdev->dev, sizeof(struct rockchip_spi));
758757
else
759-
ctlr = spi_alloc_host(&pdev->dev,
760-
sizeof(struct rockchip_spi));
758+
ctlr = spi_alloc_host(&pdev->dev, sizeof(struct rockchip_spi));
761759

762760
if (!ctlr)
763761
return -ENOMEM;
@@ -769,7 +767,7 @@ static int rockchip_spi_probe(struct platform_device *pdev)
769767
/* Get basic io resource and map it */
770768
rs->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
771769
if (IS_ERR(rs->regs)) {
772-
ret = PTR_ERR(rs->regs);
770+
ret = PTR_ERR(rs->regs);
773771
goto err_put_ctlr;
774772
}
775773

@@ -794,7 +792,7 @@ static int rockchip_spi_probe(struct platform_device *pdev)
794792
goto err_put_ctlr;
795793

796794
ret = devm_request_threaded_irq(&pdev->dev, ret, rockchip_spi_isr, NULL,
797-
IRQF_ONESHOT, dev_name(&pdev->dev), ctlr);
795+
IRQF_ONESHOT, dev_name(&pdev->dev), ctlr);
798796
if (ret)
799797
goto err_put_ctlr;
800798

@@ -804,16 +802,15 @@ static int rockchip_spi_probe(struct platform_device *pdev)
804802
if (!of_property_read_u32(pdev->dev.of_node, "rx-sample-delay-ns",
805803
&rsd_nsecs)) {
806804
/* rx sample delay is expressed in parent clock cycles (max 3) */
807-
u32 rsd = DIV_ROUND_CLOSEST(rsd_nsecs * (rs->freq >> 8),
808-
1000000000 >> 8);
805+
u32 rsd = DIV_ROUND_CLOSEST(rsd_nsecs * (rs->freq >> 8), 1000000000 >> 8);
809806
if (!rsd) {
810807
dev_warn(rs->dev, "%u Hz are too slow to express %u ns delay\n",
811-
rs->freq, rsd_nsecs);
808+
rs->freq, rsd_nsecs);
812809
} else if (rsd > CR0_RSD_MAX) {
813810
rsd = CR0_RSD_MAX;
814-
dev_warn(rs->dev, "%u Hz are too fast to express %u ns delay, clamping at %u ns\n",
815-
rs->freq, rsd_nsecs,
816-
CR0_RSD_MAX * 1000000000U / rs->freq);
811+
dev_warn(rs->dev,
812+
"%u Hz are too fast to express %u ns delay, clamping at %u ns\n",
813+
rs->freq, rsd_nsecs, CR0_RSD_MAX * 1000000000U / rs->freq);
817814
}
818815
rs->rsd = rsd;
819816
}

0 commit comments

Comments
 (0)