tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing head: c7a6b9e4df4c5d9e95e38766923f98117b045c39 commit: ba44dc04300441b47618f9933bf36e75a280e5fe [27/31] serial: Add Milbeaut serial control reproduce: # apt-get install sparse git checkout ba44dc04300441b47618f9933bf36e75a280e5fe make ARCH=x86_64 allmodconfig make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' sparse warnings: (new ones prefixed by >>) >> drivers/tty/serial/milbeaut_usio.c:503:52: sparse: Using plain integer as NULL pointer vim +503 drivers/tty/serial/milbeaut_usio.c 500 501 static int mlb_usio_probe(struct platform_device *pdev) 502 { > 503 struct clk *clk = devm_clk_get(&pdev->dev, 0); 504 struct uart_port *port; 505 struct resource *res; 506 int index = 0; 507 int ret; 508 509 if (IS_ERR(clk)) { 510 dev_err(&pdev->dev, "Missing clock\n"); 511 return PTR_ERR(clk); 512 } 513 ret = clk_prepare_enable(clk); 514 if (ret) { 515 dev_err(&pdev->dev, "Clock enable failed: %d\n", ret); 516 return ret; 517 } 518 of_property_read_u32(pdev->dev.of_node, "index", &index); 519 port = &mlb_usio_ports[index]; 520 521 port->private_data = (void *)clk; 522 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 523 if (res == NULL) { 524 dev_err(&pdev->dev, "Missing regs\n"); 525 ret = -ENODEV; 526 goto failed; 527 } 528 port->mapbase = res->start; 529 port->membase = ioremap(res->start, (res->end - res->start + 1)); 530 port->membase = devm_ioremap(&pdev->dev, res->start, 531 resource_size(res)); 532 533 ret = platform_get_irq_byname(pdev, "rx"); 534 mlb_usio_irq[index][RX] = ret; 535 536 ret = platform_get_irq_byname(pdev, "tx"); 537 mlb_usio_irq[index][TX] = ret; 538 539 port->irq = mlb_usio_irq[index][RX]; 540 port->uartclk = clk_get_rate(clk); 541 port->fifosize = 128; 542 port->iotype = UPIO_MEM32; 543 port->flags = UPF_BOOT_AUTOCONF | UPF_SPD_VHI; 544 port->line = index; 545 port->ops = &mlb_usio_ops; 546 port->dev = &pdev->dev; 547 548 ret = uart_add_one_port(&mlb_usio_uart_driver, port); 549 if (ret) { 550 dev_err(&pdev->dev, "Adding port failed: %d\n", ret); 551 goto failed1; 552 } 553 return 0; 554 555 failed1: 556 iounmap(port->membase); 557 558 failed: 559 clk_disable_unprepare(clk); 560 clk_put(clk); 561 562 return ret; 563 } 564 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation